Could u please tell me why the following codes cannot run in webservice while
these codes can be run in a window form? Thanks.
The following is the error messge from IE:"HTTP 500 - Internal server error
" after I invoked.And I went through step by step debugging, the same error
message was shown,no further information.
[WebMethod]
public string test()
{
DataRow tempRow;
SqlXmlAdapter ad;
MemoryStream ms=new MemoryStream();
SqlXmlCommand cmd=new SqlXmlCommand("Provider=SQLOLEDB;data
source=\"127.0.0.1\";initial catalog=Northwind;user id=\"test\";
password=\"test\"");
cmd.RootTag="ROOT";
cmd.CommandText="Emp";
cmd.CommandType=SqlXmlCommandType.XPath;
cmd.SchemaPath="..\\XMLSchema1.xsd";
DataSet ds = new DataSet();
ad=new SqlXmlAdapter(cmd);
ad.Fill(ds);
tempRow=ds.Tables["Emp"].Rows[0];
tempRow["FName"] = "Susan";
ad.Update(ds);
return "ok";
}
the codes in windows form:
private void button2_Click(object sender, System.EventArgs e)
{
DataRow row;
SqlXmlAdapter ad;
MemoryStream ms = new MemoryStream();
SqlXmlCommand cmd=new SqlXmlCommand("Provider=SQLOLEDB;data
source=\"127.0.0.1\";initial catalog=Northwind;user id=\"test\";
password=\"test\"");
cmd.RootTag = "ROOT";
cmd.CommandText = "Emp";
cmd.CommandType = SqlXmlCommandType.XPath;
cmd.SchemaPath = "..\\XMLSchema1.xsd";
DataSet ds = new DataSet();
ad = new SqlXmlAdapter(cmd);
ad.Fill(ds);
row = ds.Tables["Emp"].Rows[0];
row["FName"] = "Susan";
ad.Update(ds);
textBox1.Text="It is ok.";
}
Chad Z. Hower aka Kudzu - 11 May 2005 06:42 GMT
> The following is the error messge from IE:"HTTP 500 - Internal server
> error " after I invoked.And I went through step by step debugging, the
In IE, turn off friendly errors and try again. I suspect I know what you
problem already is, but Im not going to chase ghosts, I need more info.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"
Blog: http://blogs.atozed.com/kudzu