无法将类型为"System.Windows.Forms.TextBox"的对象强制转换为类型"System.IConvertible".
if(textBox7.Text==""||textBox17.Text==""){MessageBox.Show("请输入编号","信息提示",System.Windo...
if (textBox7.Text == "" || textBox17.Text == "")
{
MessageBox.Show("请输入编号", "信息提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Warning);
}
else
{
DataSet ds = new DataSet();
string sql = "select * from product where product_id='"+textBox7.Text+"'";
OracleConnection con = new OracleConnection(str1);
con.Open();
OracleDataAdapter da = new OracleDataAdapter(sql,con);
da.Fill(ds);
if (ds.Tables[0].Rows.Count > 1)
{
MessageBox.Show("信息已存在,请更换产品编号");
}
else
{
for (int i = Convert.ToInt32(textBox7.Text); i < Convert.ToInt32(textBox17); i++)
{
sql = string.Format(@"insert into product(product_id,pptype_id,pname,pmade) values('{0}','{1}','{2}','{3}')", i.ToString(), comboBox1.Text.Trim(), textBox8.Text.Trim(), textBox10.Text.Trim());
OracleConnection cons = new OracleConnection(str1);
;
OracleCommand cmd = new OracleCommand(sql, cons); 展开
{
MessageBox.Show("请输入编号", "信息提示", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Warning);
}
else
{
DataSet ds = new DataSet();
string sql = "select * from product where product_id='"+textBox7.Text+"'";
OracleConnection con = new OracleConnection(str1);
con.Open();
OracleDataAdapter da = new OracleDataAdapter(sql,con);
da.Fill(ds);
if (ds.Tables[0].Rows.Count > 1)
{
MessageBox.Show("信息已存在,请更换产品编号");
}
else
{
for (int i = Convert.ToInt32(textBox7.Text); i < Convert.ToInt32(textBox17); i++)
{
sql = string.Format(@"insert into product(product_id,pptype_id,pname,pmade) values('{0}','{1}','{2}','{3}')", i.ToString(), comboBox1.Text.Trim(), textBox8.Text.Trim(), textBox10.Text.Trim());
OracleConnection cons = new OracleConnection(str1);
;
OracleCommand cmd = new OracleCommand(sql, cons); 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询