jjjjjjjjjjjjjjjjjjjjjjjjjjj
Printable View
jjjjjjjjjjjjjjjjjjjjjjjjjjj
That will then display the value of the SomeProperty property of your list items in the Label. To navigate the list you would set the Position property of the BindingSource or call a method like MoveNext.CSharp Code:
this.BindingSource1.DataSource = myObj.GetDepartmentsByUserID(); this.Label1.DataBindings.Add("Text", this.BindingSource1, "SomeProperty");
That said, your code makes no sense to me. Why does your method have two arguments that never get used?
My UI code is in VB not in c# where i am binding the lable.Can you please give me the code in vb?
How hard is it to convert that? This becomes Me, remove the semi colons, you're done.
It's VB.net.We don't have DataBindings and BindingSource in VB.Net
You wouldn't happen to be making a web application, would you?
Of course you do. They're both part of the .NET Framework so they "exist" in every .NET language, whether that be C#, VB, C++, J#, Delphi or whatever.Quote:
Originally Posted by sha_shivani
That said, they are both specific to Windows Forms, so if you're creating a Web app, as mendhak suggested, then you won't have access to the BindingSource class or the DataBindings property.
It's important to provide all the relevant information when you post. You've posted in the C# forum so of course people will respond with C# code. If you want VB code then you should either be posting in the VB forum or at least telling us that your using multiple languages and need this code in VB. Given that this site has an ASP.NET forum, if you post in a language forum then people are going to assume that it's Windows Forms in most cases. Please provide a full and proper description of your issue from the start in future to avoid wasting our time and yours.