reader = cmd.ExecuteReader();
reader.Read();
string StrDz = reader["Str"].ToString();
//StrDz 结果:StrDz="00","黄平","生活","0","",",","","","15","","38"
this.TxtYhm.Text = styhxx[0];//TxtYhm.Text="00","黄平","其它","0","",",","","","15","","38"
reader.Close();
我想的结果为:
styhxx[0]=00;
styhxx[1]=黄平;
styhxx[2]=其它;
依此类推,
reader.Read();
string StrDz = reader["Str"].ToString();
//StrDz 结果:StrDz="00","黄平","生活","0","",",","","","15","","38"
this.TxtYhm.Text = styhxx[0];//TxtYhm.Text="00","黄平","其它","0","",",","","","15","","38"
reader.Close();
我想的结果为:
styhxx[0]=00;
styhxx[1]=黄平;
styhxx[2]=其它;
依此类推,
但是结果却为:
TxtYhm.Text="00","黄平","其它","0","",",","","","15","","38"。
郁闷啊
Split(',')
但是结果为:
Dyhxx[0]="00","黄平","其它","0","",",","","","15","","38".
我想要结果:
Dyhxx[0]=00;
while(reader.Read())
{
styhxx[0]=reader.getvalue(0).tostring();
stryhxx[1]=reader.getvalue(1).tostring();
...
}