View Single Post
  #1 (permalink)  
Old September 26th, 2010, 05:37 AM
Cade_Feng Cade_Feng is offline
Authorized User
Join Date: Aug 2010
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Cade_Feng
Post Get a certain Field's valuer from DataBase


I want to get a certain field's value from Database;

But I don't know how to get it;

string _StuName=string.Empty;
SqlConnectionStringBuilder _sqlCon = new SqlConnectionStringBuilder();
SqlConnection con = new SqlConnection(_sqlCon.ConnectionString);
SqlCommand command = new SqlCommand(@"select top 1 StudentName from StudentInfo");
Then How can I got "StudentName" this Field's value?
And keep it.
Wana be a .net developer.
Sincere yours