Im havin a problem to get values from a table into variables, setting each variable with row values. To get values per column is easy I use this code: string sql = "select val from fmFactor";
conn.Open();
OdbcCommand cmd =
new OdbcCommand(sql,conn);OdbcDataReader dr = cmd.ExecuteReader();
while(dr.Read()){
fmDiscount = dr.GetDouble(0);
fmAdvert = dr.GetDouble(1);
fmExcess = dr.GetDouble(2);
fmTotal = dr.GetDouble(3);
}
conn.Close();
----
but thats for diffirent colums not rows
but Im stuck. o and im not using the dataset and adapters stuff to use the datarow thing.
thanx
hari kondlapudiPosted Jun 5, 2007, 3:45 PM
string sql = "select val1, val2, val3, val4 from fmFactor";
then your rest of code will work. If you have in database val1, val2, val3 and val4 double fields
--Hari