Felipe Marks

Felipe Marks

  • NA
  • 76
  • 0

values from database

Jun 1 2007 6:38 AM
Hi there

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
if any12 could assist me in this. I don't think its difficult at all tho
but Im stuck. o and im not using the dataset and adapters stuff to use the datarow thing.

thanx

  

Answers (1)