主题:有点问题,哪位大虾帮忙给改改啊
这段代码有点问题,我想要把表中的数据修改成我用select 语句检索出来的数据,可是他把所有记录都给更新成取到的最后一条 数据 拉 ,迷糊阿!!!
Dim commm As OracleClient.OracleCommand
Dim commm1 As OracleClient.OracleCommand
Dim datareader As System.Data.IDataReader
commm = OracleConnection1.CreateCommand()
commm.CommandText = "SELECT SP_NAME,SP_COLOR,SP_NUM,SP_SIZE,SP_CUP FROM Z_T_COMMODITY WHERE LX1='" + TextBox1.Text + "' AND LX2='" + TextBox3.Text + "' AND LX3='" + TextBox2.Text + "' "
OracleConnection1.Open()
datareader = commm.ExecuteReader()
Do While datareader.Read
commm.CommandText = "UPDATE Z_TP SET SP_NAME='" & datareader(0) & "',SP_COLOR='" & datareader(1) & "',SP_NUM='" & datareader(2) & "'"
commm.CommandType = CommandType.Text
commm.ExecuteNonQuery()
Loop
OracleConnection1.Close()
OracleDataAdapter1.Fill(DataSet11.Z_TP)
[em78][em78][em78][em78][em78][em78][em78][em78][color=00FF00]有点问题,哪位大虾帮忙给改改啊[/color]
Dim commm As OracleClient.OracleCommand
Dim commm1 As OracleClient.OracleCommand
Dim datareader As System.Data.IDataReader
commm = OracleConnection1.CreateCommand()
commm.CommandText = "SELECT SP_NAME,SP_COLOR,SP_NUM,SP_SIZE,SP_CUP FROM Z_T_COMMODITY WHERE LX1='" + TextBox1.Text + "' AND LX2='" + TextBox3.Text + "' AND LX3='" + TextBox2.Text + "' "
OracleConnection1.Open()
datareader = commm.ExecuteReader()
Do While datareader.Read
commm.CommandText = "UPDATE Z_TP SET SP_NAME='" & datareader(0) & "',SP_COLOR='" & datareader(1) & "',SP_NUM='" & datareader(2) & "'"
commm.CommandType = CommandType.Text
commm.ExecuteNonQuery()
Loop
OracleConnection1.Close()
OracleDataAdapter1.Fill(DataSet11.Z_TP)
[em78][em78][em78][em78][em78][em78][em78][em78][color=00FF00]有点问题,哪位大虾帮忙给改改啊[/color]