|
-
Sep 18th, 2002, 01:13 AM
#1
Thread Starter
Addicted Member
Checking db for a record
humm ok I am doing a poll on a database to see if a record is present, is there a way get a field out of the record that I am polling?? I looked at the fields of the dataset but I couldn't see anything. here is what I have so far....
private void CheckCompany(string CompanyName){
string path = "%";
path += CompanyName;
path += "%";
string strConnection = "server=localhost; uid=sa; pwd=; database=Test";
string strCommand = "SELECT [Company Name] FROM List WHERE [Company Name] LIKE '"+path+"'";
SqlDataAdapter dataAdapter = new SqlDataAdapter(strCommand,strConnection);
DataSet dataSet = new DataSet();
dataAdapter.Fill(dataSet,"Companies");
SqlCommandBuilder bldr = new SqlCommandBuilder(dataAdapter);
DataTable dataTable = dataSet.Tables[0];
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|