473,385 Members | 1,890 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

When i connect my vb.net with sql database i got this msg

Expand|Select|Wrap|Line Numbers
  1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  2.         Dim connection As New SqlClient.SqlConnection
  3.         Dim command As New SqlClient.SqlCommand
  4.         Dim adaptor As New SqlClient.SqlDataAdapter
  5.         Dim dataset As New DataSet
  6.         connection.ConnectionString = ("Data Source=.\SQLEXPRESS;CYRUS-PC\SQLEXPRESS\Databases\sample\Tables\dbo.Login=|DataDirectory|\DataBase.mdf;Integrated Security=True;User Instance=True")
  7.         command.CommandText = "SELECT * FROM Login WHERE UserName='" & TextBox1.Text & "' AND Passwords='" & TextBox2.Text & "';"
  8.         connection.Open()
  9.         command.Connection = connection
  10.         adaptor.selectCommand = command
  11.         adaptor.Fill(dataset, "0")
  12.         Dim count = dataset.Tables(0).Rows.Count
  13.         If count > 0 Then
  14.             MsgBox("Login Successfull", MsgBoxStyle.Information, "Login Passed")
  15.         Else
  16.             MsgBox("Invalid Account", MsgBoxStyle.Critical, "Login Failed")
  17.             txtUsernameBox1.Clear()
  18.             txtpassword.Clear()
  19.         End If
  20.     End Sub
  21.  
Sep 26 '14 #1
1 1248
Frinavale
9,735 Expert Mod 8TB
What message do you get?
Oct 16 '14 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: zelzel.zsu | last post by:
What is php's behavior when connect to a db? I've been told that php was once a dominant web programing language. I've read a few chapters of a php book. I was wonder what's php's performance....
0
by: programer | last post by:
Can I use Activex (as vb) to connect database when I use vc.net.
3
by: venkatesh | last post by:
hai to everybody I need to know how to connect database ms access or oracle with c or c++? please if u know tell I am interested in doing project with c thanks in advance....
1
by: arun_kumar112 | last post by:
HI , I am new member of this comminity, let me introduce first, i am MCA final year student, doing a project on network system, and database . will you tell me how can we connect database (...
1
by: nagendra prasad | last post by:
how to connect database for visualbasic using ADO
3
by: Raymond Chiu | last post by:
Dear All, I have posted my question as below. But no answers, hope it can found here. ...
3
by: iedayah88 | last post by:
can sombody help me..after i create database in oracle.. what i must do to connect database and sql.. it's i must setup odbc first? is yes, how to setup odbc in localhost?
2
by: chetan ghadiya | last post by:
how to connect database in vb ?
1
by: rishiverma | last post by:
how to connect database create in sql server ,to my web site upload on domain.
0
by: otomatis | last post by:
Hi All, I got this error when updating database from datatable. {"Update unable to find TableMapping or DataTable 'Table'."} Here is my code (modified) : SqlCeDataAdapter da = new...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.