本文介绍了应该是下面代码中的连接字符串的确切内容(数据库名称是USER,表名也是USER)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞!Imports System.Data.SqlClientImports System.LinqImports System.DataPublic Class Form Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 'Dim conn As SqlConnection 'Dim cmd As SqlCommand Dim rd As SqlDataReader Dim conn As New SqlConnection() Dim cmd As New SqlCommand() conn.ConnectionString = "Data Source=localhost;Initial Catalog=user;Integrated security=true" cmd.Connection = conn conn.Open() cmd.CommandText = "Select login,password from user where login='" & TextBox1.Text & "'and password='" & TextBox2.Text & "'" rd = cmd.ExecuteReader If rd.HasRows Then Welcome.Show() Else MsgBox("Invalid Login or Password") End If End SubEnd Class推荐答案 这篇关于应该是下面代码中的连接字符串的确切内容(数据库名称是USER,表名也是USER)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-05 06:11