我在一个类里面写了个方法,返回DataSet类型.public System.Data.DataSet GetAllCfxmflyjInfo(string id)
{
System.Data.DataSet functionReturnValue = null;
functionReturnValue = null;
string strSql = "";
strSql = "select FLFG";
strSql = strSql + " from 事项 where ID=" + id;
DataSet datCfxmDatSet = new DataSet();
OracleDataAdapter da;
OracleConnection oraConn = new OracleConnection(s_MapgisConn);
try {
oraConn.Open();
da = new OracleDataAdapter(strSql, oraConn);
da.Fill(datCfxmDatSet, "行政处罚事项");
functionReturnValue = datCfxmDatSet;
}
catch (Exception ex) {
functionReturnValue = null;
}
finally {
oraConn.Close();
datCfxmDatSet = null;
da = null;
oraConn = null;
}
return functionReturnValue;
} 在别的页面我直接NEW()一下,然后调用这个方法,可以把数据取出来放在页面!但我把它放在webService中[WebMethod()]
public System.Data.DataSet GetCfxmFlfgInfo(ref string id)
{
OracleDAL.XMCFINFO CfxmFlfg = new OracleDAL.XMCFINFO();
return CfxmFlfg.GetAllCfxmflyjInfo(id);
} 然后在页面调用webService中的GetCfxmFlfgInfo()方法的时候,却取不出来值,请告诉我这个是怎么会事情
请高手帮我写点具体代码来实现!怎么调用才可以取出来值.十万火急!
{
System.Data.DataSet functionReturnValue = null;
functionReturnValue = null;
string strSql = "";
strSql = "select FLFG";
strSql = strSql + " from 事项 where ID=" + id;
DataSet datCfxmDatSet = new DataSet();
OracleDataAdapter da;
OracleConnection oraConn = new OracleConnection(s_MapgisConn);
try {
oraConn.Open();
da = new OracleDataAdapter(strSql, oraConn);
da.Fill(datCfxmDatSet, "行政处罚事项");
functionReturnValue = datCfxmDatSet;
}
catch (Exception ex) {
functionReturnValue = null;
}
finally {
oraConn.Close();
datCfxmDatSet = null;
da = null;
oraConn = null;
}
return functionReturnValue;
} 在别的页面我直接NEW()一下,然后调用这个方法,可以把数据取出来放在页面!但我把它放在webService中[WebMethod()]
public System.Data.DataSet GetCfxmFlfgInfo(ref string id)
{
OracleDAL.XMCFINFO CfxmFlfg = new OracleDAL.XMCFINFO();
return CfxmFlfg.GetAllCfxmflyjInfo(id);
} 然后在页面调用webService中的GetCfxmFlfgInfo()方法的时候,却取不出来值,请告诉我这个是怎么会事情
请高手帮我写点具体代码来实现!怎么调用才可以取出来值.十万火急!
解决方案 »
- 如何控制鼠标移动?
- 视频上画线
- 如何在form中嵌入一个word编辑控件
- 求助: 控制台程序. do while 循环中,为何第二次执行到此位置时系统会出错呢??说是参数不正确??
- 用户登录后返再回到原来的页面怎么写啊,不是在登录页面写
- 初学C#想做个聊天工具练练手,请各位大大指教下如何入手,非常感谢
- wpf 窗体继承
- Microsoft Jet 数据库引擎打不开文件'c:\inetpub\wwwroot\test\db1.mdb'。 它已经被别的用户以独占方式打开,或没有查看数据的权限。
- 不难,但我不会?我的visual c#.net中的一个功能不见了
- 拜托各位了!
- 数据库删除不成功
- 【50分】为什么我的程序第一次运行很快,以后就很慢了?
{
System.Data.DataSet functionReturnValue = null;
functionReturnValue = null;
string strSql = "";
strSql = "select FLFG";
strSql = strSql + " from 事项 where ID=" + id;
DataSet datCfxmDatSet = new DataSet();
OracleDataAdapter da;
OracleConnection oraConn = new OracleConnection(s_MapgisConn);
try {
oraConn.Open();
da = new OracleDataAdapter(strSql, oraConn);
da.Fill(datCfxmDatSet, "行政处罚事项");
functionReturnValue = datCfxmDatSet;
return functionReturnValue; //here return }
catch (Exception ex) {
functionReturnValue = null;
}
finally {
oraConn.Close();
datCfxmDatSet = null;
da = null;
oraConn = null;
}
}
当然什么都没有了~
return 的是functionReturnValue,应该不存在我说的问题~
试一下看可不可以
不可以再找其它原因
finally总是要执行的。
放在后面肯定是null听。