Thanks a lot, my update function is working,thanks a lot, now here's my retrieve and create function which are still complaining about the datarow when i
compile. So under the create function where "r=ds.tblDocument.NewRow" it says cannot convert method group "NewRow" to non-delegate type 'busl.tblDocumentRow' did you intend to invoke the method?
Under the retrieve Function the 'r' in for each statement says "a local variable named 'r' cannot be declared in this scope it would give a different meaning to 'r' which is already used in a parent or current to denote something else".
And one last thing in
vb i was using collection(dim col as new collection) so in c# i used arraylist, i don't know if i'm going astray. I know this is too much but i need thanks in advance. Thanks a lot.
publicstring create(Docs dc)
{
busl.tblDocumentRow r;
Dbconnection cd = newDbconnection();
SqlDataAdapter adp = newSqlDataAdapter("Select * From Account", cd.con);
SqlCommandBuilder cmb = newSqlCommandBuilder(adp);
string msg;
r = ds.tblDocument.NewRow;
r.id = dc.id;
r.Description=dc.description;
r.Fpath=dc.filepath;
r.Datec = dc.dc;
r.Createdby=dc.usrC;
ds.tblDocument.Rows.Add(r); //for all fields
adp.Update(ds.tblDocument);
ds.AcceptChanges();
msg = "Success";
return msg;
}
publicArrayList Retrieve(string strCriteria )
{
ArrayList col = newArrayList();
Docs usr = newDocs();
busl.tblDocumentRow r;
//NullableDataReader r = New NullableDataReader();
Dbconnection cd = newDbconnection();
SqlDataAdapter adp = newSqlDataAdapter("Select * From Account Where " + strCriteria, cd.con);
SqlCommandBuilder cmb = newSqlCommandBuilder(adp);
adp.Fill(ds.tblDocument);
foreach (busl.tblDocumentRow r in ds.tblDocument.Rows)
{
usr.id = r.id;
usr.description=r.Description;
usr.filepath=r.Fpath;
usr.dc=r.Datec;
usr.usrC=r.Createdby;
usr.fieds.Add(r.id);
usr.fieds.Add(r.Description);
usr.fieds.Add(r.Fpath);
usr.fieds.Add(r.Datec);
usr.fieds.Add(r.Createdby);
col.Add(usr);
return col;
}
}