Gustavo

Gustavo

  • NA
  • 1.3k
  • 452.6k

How do I: Read the data selected?

Mar 15 2010 5:49 PM


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)