Hi
I wonder if anyone can help me i am stuck on trying to retrieve a current value from a Bindingsource which has only one row. I have recently moved from VB to C# and i had it working perfectly in VB. My project is a windows application.
The vb code that worked for me was
greeting.Text = "Good Morning" & " " & Me.PersonBindingSource.Current("firstname").ToString & ""
I tried the following in C#
lbl_greeting.Text = personBindingSource.Current("firstname".ToString().ToString());
except it keeps throwing up
Non-Invocable member 'systems.windows.forms.bindingsource.current' cannot be used like a method.
Please can someone help me out. I would be very greatfull!
Thanks
Loading
Dipa AhujaPosted May 4, 2010, 1:32 PM
khuram tanweerPosted May 4, 2010, 12:26 PM
as for the code tips it doesnt say anything for current except that it retrieves the current value.
I guess im not going to get this done.
thanks
Dipa AhujaPosted May 4, 2010, 11:10 AM
Dipa AhujaPosted May 4, 2010, 11:04 AM
khuram tanweerPosted May 4, 2010, 10:55 AM
the example i gave above was from vb the one below is the one from C#
i am using this and it is still bringing up the error i mentioned above
lbl_greeting.Text = this.personBindingSource.Current("firstname".ToString().ToString());
I have 3 columns in my personBindingSource and i want to retrieve the current value in the "firstname" column
i know i can bind my textbox to this datasource however i need to process the results i get back from the "firstname" column so this is the best way for me to do it.
Is it simply a Syntax?
Dipa AhujaPosted May 4, 2010, 10:44 AM