12
Answers

How do I: Read the data selected?

Gustavo

Gustavo

14y
2.2k
1


Hello:
 
I am using the following code to get a record. In the DBDataAdapter , how do I get the specific field I want? It does not like the ReadRecord.
DBSQLSelect =
"SELECT "
+
" [SEQNO]"
+
" ,[Status_ID]"
+
" ,[Class_ID]"
+
" ,[Group_ID]"
+
" ,[Type_ID]"
+
" ,[CreateBy]"
+
" ,[CreateDate]"
+
" ,[CreateTime]"
+
" ,[Note]"
+
" ,[Address_1]"
+
" ,[Address_2]"
+
" ,[Address_3]"
+
" ,[City]"
+
" ,[State_ID]"
+
" ,[Zip_ID"
+
" ,[Phone]"
+
" ,[Fax]"
+
" ,[WebSite]"
+
" FROM"
+
" [" + FileName + "]"
+
" WHERE"
+
" [Company_ID] = '" + textBoxCompany_ID.Text + "'"
;
//MessageBox.Show("DBSQLSelect=" + DBSQLSelect);
//
Program.SQLSelect(DBSQLSelect);
//
SqlDataAdapter DBDataAdapter = new SqlDataAdapter(Program.ProgramDBSelect, Program.ProgramDBConnection);
SqlDataReader ReadRecord;
textBoxName.Text = ReadRecord.GetString(ReadRecord.GetOrdinal(
"Name"));

Answers (12)