Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DataReleation Error!
Message
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Divers
Thread ID:
00751078
Message ID:
00754664
Vues:
22
You shouldn't set the DataSource property and call the SetDataBinding method. The SetDataBinding method is how you set the DataSource and DataMember of the DataGrid at runtime. You are setting it in code so it is not necessary to use this method.

>Hi Cathi,
>
>I fixed the datarelation problem. But it’s spoiling my databinding, when I add this line to my datagrid:
>Me.dgMeasurements.SetDataBinding(myDS, "Member.MemMsr")
>
>This is the code, I think I am missing somethign some where??
>
>
>myDA.Fill(myDS, "Member")
>myMeasureDA.Fill(myDS, "Measure")
>
>‘ Add DataRelation the DataSet
>myDS.Relations.Add("MemMsr", myDS.Tables("Member").Columns("MemberID"), myDS.Tables("Measure").Columns("MemberID"))
>
>' cbSelect Member DataSource
>Me.cbSelect.DataSource = myDS.Tables("Member")
>Me.cbSelect.DisplayMember = "MemberID"
>
>‘ Bind data in the first window form
>Me.txtMemberName_e.DataBindings.Add("Text", myDS.Tables("Member"), "Name_e")
>
>Me.dgMeasurements.DataSource = myDS.Tables("Measure")
>
>‘ the next line is spoiling my next databinding
>Me.dgMeasurements.SetDataBinding(myDS, "Member.MemMsr")
>
>‘ bind the 2nd window form (*** this binding get spoiled ***)
>Me.txtWeight.DataBindings.Add("Text", myDS.Tables("Measure"), "Weight")
>Me.txtHeight.DataBindings.Add("Text", myDS.Tables("Measure"), "Height")
>
>Thanks for the help
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform