首页 新闻 会员 周边

websevice 连接oracle数据库

0
悬赏园豆:10 [待解决问题]

public object Getlife1(string SQLString)
{

using (OracleConnection connection = new OracleConnection("Data Source=wgcs;Persist Security Info=True;User ID=wgcs;Password=wgcs;Unicode=True"))
{
using (OracleCommand cmd = new OracleCommand(SQLString, connection))
{
try
{
connection.Open();无法解析制定则字符串
object obj = cmd.ExecuteScalar();
if ((Object.Equals(obj, null)) || (Object.Equals(obj, System.DBNull.Value)))
{
return null;
}
else
{
return obj;
}
}
catch (System.Data.SqlClient.SqlException e)
{
connection.Close();
throw e;
}
finally
{
cmd.Dispose();
connection.Close();
}
}
}

 

连接字符串肯定没问题

life steven的主页 life steven | 初学一级 | 园豆:72
提问于:2013-09-09 11:07
< >
分享
所有回答(1)
0
dudu | 园豆:31003 (高人七级) | 2013-09-09 11:21
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册