数据库里是这样A B C D E F G
54 68 63 79 77 83 47
10 31 72 26 16 85 10
56 14 61 15 74 12 16
92 50 27 40 32 51 10
56 30 75 56 27 16 83
54 83 58 78 30 26 78
87 13 10 77 25 2 38我想 在文本框 输入 A1 B1 C1 读取 这个值来 也就是读出 54 68 63
用什么办法 实在想不到了 请大家指教下 谢谢。
54 68 63 79 77 83 47
10 31 72 26 16 85 10
56 14 61 15 74 12 16
92 50 27 40 32 51 10
56 30 75 56 27 16 83
54 83 58 78 30 26 78
87 13 10 77 25 2 38我想 在文本框 输入 A1 B1 C1 读取 这个值来 也就是读出 54 68 63
用什么办法 实在想不到了 请大家指教下 谢谢。
for(int i=0;i<ds.Tables[0].Rows;i++)
{
string s=ds.Tables[0].Rows[i]["A"].ToString();
}
for(int i=0;i<ds.Tables[0].Rows.Count;i++)
{
string s=ds.Tables[0].Rows[0][i].ToString();
}
Rows右面有两个数,第一个是行,第二个是咧
这样循环取出第一行数据、、取前三列,即A,B,C
int b2 = Convert.ToInt32(textBox2.Text.Substring(1, 1));
int b3 = Convert.ToInt32(textBox3.Text.Substring(1, 1));
string strsql = "select * from abc_004";
OleDbDataAdapter da = new OleDbDataAdapter(strsql, conn);
DataSet ds = new DataSet();
da.Fill(ds, "abc_004");
label1.Text = ds.Tables[0].Rows[b1]["A"].ToString() + ds.Tables[b2].Rows[0]["B"].ToString() + ds.Tables[0].Rows[b3]["C"].ToString();为什么这样提示 找不到表1.
这里的参数 能填变量吗 因为我 这个 要在前台 输入 比如A1 F1 一类的 所有这里的行和 列名不能固定