use datareader : dim dr as sqldatareader dim command as sqlcommand command=new sqlcommand("select...",connection) commamd.connection.open dr=command.excutereader dim temp as string while dr.read temp=dr("id") temp=dr.getstring(0) end whileuse dataadapter: da.fill(ds,"tt") dim dt as datatable dt=ds.tables("tt") temp=dt.rows(index)(columnindex)
dim dr as sqldatareader
dim command as sqlcommand
command=new sqlcommand("select...",connection)
commamd.connection.open
dr=command.excutereader
dim temp as string
while dr.read
temp=dr("id")
temp=dr.getstring(0)
end whileuse dataadapter:
da.fill(ds,"tt")
dim dt as datatable
dt=ds.tables("tt")
temp=dt.rows(index)(columnindex)
……
OleDbDataReader reader;
reader =myCmd.ExecuteReader();
……
for(int i=0;i<reader.FieldCount;i++)
{
string FieldName=reader.GetName(i);
……}