i have made a program to get data from SQL
i have done it before but i lost the files when i tried to make it again
i got ( Index was outside the bounds of the array ) something like that
Here Is The Connection
and here is the error part
the strange thing that i have made it before like this and it worked
so any solution ?
________
sry english not my first language
i have done it before but i lost the files when i tried to make it again
i got ( Index was outside the bounds of the array ) something like that
Here Is The Connection
Dim Connection As String = String.Empty LUsername = TextBox3.Text LPassword = TextBox4.Text Server = TextBox1.Text Database = TextBox2.Text Connection = "Data Source=" & Server & ";Initial Catalog=" & Database & ";User Id=" & LUsername & ";Password=" & LPassword & ";Integrated Security=SSPI;MultipleActiveResultSets=True;Trusted_Connection=True;" con.ConnectionString = Connection Try con.Open() Catch ex As SqlException End Try
and here is the error part
Dim command As New SqlCommand("SELECT id FROM dbo.users", FLogin.con) Dim reader As SqlDataReader reader = command.ExecuteReader While reader.Read MsgBox(reader(1).ToString) End While
the strange thing that i have made it before like this and it worked
so any solution ?
________
sry english not my first language