c#获取oracle数据库表字段名,请写明具体步骤,在线等~~~
发布网友
发布时间:2023-07-12 01:49
我来回答
共2个回答
热心网友
时间:2024-11-15 18:48
1.private void button2_Click(object sender, EventArgs e)
2.{
3. OracleConnection conn = dbc.getConnection();//获得conn连接
4. try
5. {
6. conn.Open();
7. OracleCommand cmd = conn.CreateCommand();
8. cmd.CommandText = "SELECT zp FROM kk.kkbj WHERE xh = 2345 ";//查询获得图片流
9.
10. OracleDataReader reader = cmd.ExecuteReader();//创建一个OracleDateReader对象
11. reader.Read();
12.
13. MemoryStream ms = new MemoryStream((byte[])reader["zp"]);
14.
15. Image image = Image.FromStream(ms, true);
16.
17. reader.Close();
18. conn.Close();
19.
20. pictureBox1.Image = image;
21. }
22. catch (Exception ee)
23. {
24. MessageBox.Show(ee.Message.ToString());
25. }
26.
27.}
热心网友
时间:2024-11-15 18:49
获取的数据表DataTable有字段的属性
或者直接调用sql:select column_name from user_tab_columns where table_name = 'XXX'
取得XXX表的列明的datatable集合,不知道哪个适合你追问如何获取DataTable?