私は学部生としてビジュアル スタジオ 08 に取り組んでおり、ビジュアル スタジオ 12 で当時のプロジェクトの開発を開始したいと考えています。どうすれば... .mdf ファイルをインポートするオプションはありません。
どんな助けでも感謝されます。
上記の質問に対する答えが得られました。データベースに接続しましたが、コードを実行するとエラーが発生します。
Visual Basic で Web アプリケーションを作成しようとしています。
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Conn As String = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString
Dim password As String
password = Encrypt(TextBox2.Text, "&%#@?,:*")
'Queries
Dim query As String = "select * from Registration where username='" & TextBox1.Text & "' and password='" & password & "'"
Dim SQLConn As New SqlConnection(Conn)
Dim SQLCmd As New SqlCommand(query, SQLConn)
SQLConn.Open()
Dim dr As SqlDataReader
dr = SQLCmd.ExecuteReader()
dr.Read()
' If Present in databse it will enter here
If dr.HasRows Then
' Remember Session
'Session("viewid") = dr("userid")
Session("userid") = dr("userid")
Session("username") = dr("username")
Session("email") = dr("email")
'Remember Me on this pc
If CheckBox1.Checked Then
Response.Cookies("UserName").Value = dr("username")
Response.Cookies("UserName").Expires = DateTime.Now.AddMonths(1)
End If
Response.Redirect("Home.aspx")
End If
SQLConn.Close()
Label4.Text = "* Incorrect Username/ Password/ Mode. Re-enter!"
End Sub
SQLConn.Open() でエラーが発生します。
SqlException はユーザー コードによって処理されませんでした
SQL Server のユーザー インスタンスに接続する場合、ユーザー インスタンス ログイン フラグは許可されません。接続が閉じられます。
誰かが何をする必要があるか教えてもらえますか?