-
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];
}
-
Iterate through "dataTable" Rows and specify the field.