Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
inkimar
Starting Member
3 Posts |
Posted - 2006-03-24 : 06:49:05
|
| Hello!Doing some C# and trying to access my db.Following a book from Wrox, they use VB - there is my problem.How would I translate the following to C# ?Dim PKvalue As String = FilterInput.Text; // Filterinput är en textboxDIM Rowlocated AS DataRow = Me.MyDBDataSet.Person.Rows.Find(CType(PKvalue,Integer))If Not ( RowLocated Is Nothing) Then MessageBox.Show(CType(Rowlocated(1),String)) Else MessageBox.Show(PKvalue & " record not located" )End ifHopefully you are able to help me.regards, i |
|
|
ditch
Master Smack Fu Yak Hacker
1466 Posts |
Posted - 2006-03-24 : 06:58:26
|
http://www.developerfusion.co.uk/Utilities/convertvbtocsharp.aspxDuane. |
 |
|
|
inkimar
Starting Member
3 Posts |
Posted - 2006-03-24 : 07:52:36
|
| Thank you Duane!Greatest tip today!Regards,i"But if thought corrupts language, language can also corrupt thought." -George Orwell |
 |
|
|
inkimar
Starting Member
3 Posts |
Posted - 2006-03-24 : 08:30:34
|
| Did not manage though these lines:If Not ( RowLocated Is Nothing) ThenMessageBox.Show(CType(Rowlocated(1),String))ElseMessageBox.Show(PKvalue & " record not located" )End ifregards, i"But if thought corrupts language, language can also corrupt thought." -George Orwell |
 |
|
|
|
|
|