>>Hello again
>>
>>Which is better suited for transfer data from one foxpro DBF to another foxpro DBF, DataSet or DataReader.
>>
>>I'm trying to decipher
>>
>>DataView catView = new DataView(catDS.Tables["Categories"]);
>>
>>
>>How do you define/create
catDS.Tables portion and how does this relate to DataSet or DataReader?
>>
>>TIA
>
>I would go with a DataReader and parametrized insert command.
Hello Dorin.
This is what I'm doing.
.
.
.
string lcStr1;
string lcStr2;
string lcStr3;
double lnAmt;
OleDbConnection concxn = new OleDbConnection(strConn);
concxn.Open();
OleDbCommand cmd = new OleDbCommand(strQuery, concxn);
OleDbDataReader readr = cmd.ExecuteReader();
while (readr.Read())
{
lcStr1 = readr["cust_id"].ToString();
lcStr2 = readr["Company"].ToString();
lcStr3 = readr["country"].ToString();
lnAmt = readr["maxordamt"];
strQuery = "insert into MyTarget (cust_id, Company, country, orderamt) values ('";
strQuery += lcStr1 + "', '" + lcStr2 + "', '"+lcStr2+"', '"+lnAmt+"')";
OleDbCommand cmdx = new OleDbCommand(strQuery, cn);
int ExcInsert = cmdx.ExecuteNonQuery();
}
.
.
.
C# doesn't like
lnAmt = rdr["maxordamt"];.
And I can't do
lnAmt = rdr["maxordamt"].ToString();.
How do I save maxordamt, which is a numeric (99999.99) into lnAmt variable so I can insert it into orderamt field in MyTarget table which is also numeric?
Thanks
The American Republic will endure, until politicians realize they can bribe the people with their own money.
- Alexis de Tocqueville
No man’s life, liberty, or property is safe while the legislature is in session.
– Mark Twain (1866)