| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1159 人关注过本帖
标题:cmd.ExecuteNonQuery() 这个地方老是报错整么回事?
取消只看楼主 加入收藏
L483342650
Rank: 2
等 级:论坛游民
帖 子:11
专家分:10
注 册:2021-7-19
结帖率:100%
收藏
 问题点数:0 回复次数:1 
cmd.ExecuteNonQuery() 这个地方老是报错整么回事?
Imports System.Data.SqlClient
Public Class Form1
    Private Conne As SqlConnection = New SqlConnection("Data Source=SWPDM\SWPDM;Initial Catalog=master;Integrated Security=True")
    Private Sub adddate()
        Dim cmd As SqlCommand
        Dim cmdstring As String = ("insert CustomTemp(名称,规格,材料) value (" + CStr(TextBox1.Text) + ",'" + TextBox2.Text + ",'" + TextBox3.Text + ",")
        cmd = New SqlCommand(cmdstring, Conne)
        Conne.Open()
        cmd.ExecuteNonQuery()
        Conne.Close()


    End Sub
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        adddate()


    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        TextBox1.Text = ""
        TextBox2.Text = ""
        TextBox3.Text = ""
    End Sub
End Class
搜索更多相关主题的帖子: Private Text cmd Sub End 
2021-07-19 16:04
L483342650
Rank: 2
等 级:论坛游民
帖 子:11
专家分:10
注 册:2021-7-19
收藏
得分:0 
非常感谢!
2021-07-20 13:46
快速回复:cmd.ExecuteNonQuery() 这个地方老是报错整么回事?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.106512 second(s), 11 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved