DataSet info getting lost
-
I have this set of code which is suppose to take a dataset, transfer it to a server via a web service, and then populate a databse with the information that is in the dataset however, I have an error where there appears to be no data in the dataset once it gets to the webservice, the data seems to be fine when it leaves the program, but is lost by the time it gets to the server. userinfo is the WebService here is the code for the program:
private void button2_Click(object sender, System.EventArgs e) { try { dg1.Tables[0].Rows[0]["COMPANYNAME"]=txtCompany.Text; dg1.Tables[0].Rows[0]["FAX"]=txtFax.Text; dg1.Tables[0].Rows[0]["PHONE"]=txtTelephone.Text; dg1.Tables[0].Rows[0]["POSTALCODE"]=txtZipcode.Text; dg1.Tables[0].Rows[0]["COUNTRY"]=txtCountry.Text; dg1.Tables[0].Rows[0]["STATEPROVINCE"]=txtState.Text; dg1.Tables[0].Rows[0]["CITY"]=txtCity.Text; dg1.Tables[0].Rows[0]["ADDRESS2"]=txtAddr2.Text; dg1.Tables[0].Rows[0]["ADDRESS1"]=txtAddr.Text; dg1.Tables[0].Rows[0]["Title"]=txtTitle.Text; dg1.Tables[0].Rows[0]["NAME"]=txtName.Text; dg1.AcceptChanges(); MessageBox.Show(userinfo.SetUserInfo("uberducks2", dg1, UserID.GetValue("UID").ToString())); cmdApply.Enabled=false; } catch (Exception d) { MessageBox.Show(string.Format("Error During Runtime: {0}", d.Message)); } }
This is the WebService Code:public string SetUserInfo(string AuthID, DataSet dg1, string UserID) { if (AuthID=="*****") { try { string Name=dg1.Tables[0].Rows[0]["NAME"].ToString(); string Title=dg1.Tables[0].Rows[0]["TITLE"].ToString(); string Addr=dg1.Tables[0].Rows[0]["ADDRESS1"].ToString(); string Addr2=dg1.Tables[0].Rows[0]["ADDRESS2"].ToString(); string City=dg1.Tables[0].Rows[0]["CITY"].ToString(); string State=dg1.Tables[0].Rows[0]["STATEPROVINCE"].ToString(); string Country=dg1.Tables[0].Rows[0]["COUNTRY"].ToString(); string Zipcode=dg1.Tables[0].Rows[0]["POSTALCODE"].ToString(); string Telephone=dg1.Tables[0].Rows[0]["PHONE"].ToString(); string Fax=dg1.Tables[0].Rows[0]["FAX"].ToString(); Oconn.Open(); string sqlcmd="UPDATE ACCOUNTUSER SET COMPANYNAME = '"+Company+"', NAME = '"+Name+"', TITLE= '"+Title+"', ADDRESS1='"+Addr+"', ADDRESS2='"+Addr2+"', CITY='"+City+"', STATEPROVINCE='"+State+"', COUNTRY='"+Country+"', POSTALCODE='"+Zipcode+"', TELEPHONE='"+Telephone+"', FAX='"+Fax+"' WHERE USERID='"+UserID+"';"; S