C#中datagridview用dataset绑定远程oracle中的数据却不显示,请大家帮帮忙吧
下面是代码,应该没什么问题啊,而且也没报错,就是数据都不显示privatevoidForm1_Load(objectsender,EventArgse){stringco...
下面是代码,应该没什么问题啊,而且也没报错,就是数据都不显示
private void Form1_Load(object sender, EventArgs e)
{
string connstring = "Data Source=(DESCRIPTION="
+
" (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.1)(PORT = 1521))"
+ "(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = orclserv)));"
+"User Id=fdjh_maker;Password=fdjh;";
OracleConnection con = new OracleConnection(connstring);
DataSet myset = new DataSet();
con.Open();
OracleDataAdapter adapter = new OracleDataAdapter("select * from han_table", con);
adapter.Fill(myset);
this.dataGridView1.DataSource = myset.Tables["han_table"];
} 展开
private void Form1_Load(object sender, EventArgs e)
{
string connstring = "Data Source=(DESCRIPTION="
+
" (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.1)(PORT = 1521))"
+ "(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = orclserv)));"
+"User Id=fdjh_maker;Password=fdjh;";
OracleConnection con = new OracleConnection(connstring);
DataSet myset = new DataSet();
con.Open();
OracleDataAdapter adapter = new OracleDataAdapter("select * from han_table", con);
adapter.Fill(myset);
this.dataGridView1.DataSource = myset.Tables["han_table"];
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询