I got this:
+--------+------+
| id | name |
+--------+------+
| 1 | George |
| 2 | Mathew |
| 3 | Michael |
| 4 | Jones |
+--------+------+
Now what I want to do is this.
I want to find my name Michael and copy the id “3” of Michael into a string variable in VS10
You need the following query to select the
idcolumn from the table and specifying the name condition in theWHEREclauseIf you are using Csharp in visual studio 2010, you can do something like this:
In the above code,
idValueis theidof the name you searching for andconnectionStringis a connection string to your database.You can also use lambda like this: