Dim com1 As SqlCommandDim hanliang As DoubleDim isg As IntegerFor isg = 0 To 30hanliang = CDbl(DataGridView1.Rows(isg).Cells(2).Value.ToString)Dim i As IntegerFor i = 0 To 30MsgBox(DataGridView1.Rows(i).Cells(0).Value.ToString.Trim)If DataGridView1.Rows(i).Cells(2).Value.ToString.Trim = Nothing Thenhanliang = 0.0Elsehanliang = CDbl(Me.DataGridView1.Rows(i).Cells(2).Value.ToString)End IfIf TextBox1.Enabled = True Thencomstr = "insert into t_ylyys(materialid,matername,yysid,hanliang) values ('" + TextBox8.Text.ToString.Trim & TextBox2.Text.ToString.Trim + "','" + TextBox3.Text.ToString.Trim + "','" + Trim(Me.DataGridView1.Rows(i).Cells("yysid").Value.ToString) + "',' + hanliang + ')"Elsecomstr = "update t_ylyys set hanliang= ' + hanliang + ' where materialid = '" + TextBox8.Text.ToString.Trim & TextBox2.Text.ToString.Trim + "',yysid = '" + Trim(Me.DataGridView1.Rows(i).Cells("yysid").Value.ToString) + "',matername= '" + TextBox3.Text.ToString.Trim + "' "End Ifcom1 = New SqlCommand(comstr, conn)com1.ExecuteNonQuery()
2 回答

倚天杖
TA貢獻1828條經(jīng)驗 獲得超3個贊
#include<iostream>
#include<string>
#include<fstream>
#include<sstream>
using namespace std;
class Tair //通過定義一個類來定義數(shù)據(jù)錄入的函數(shù)
{
char flight[20]; char data[20];char start[20];
char finish[20];char stime[20];char ftime[20];int price;
添加回答
舉報
0/150
提交
取消