So I installed MS SQL with all the default options. During the installation it asked me for a root password. I entered "aTest1!"
When I open up the management tools I get this:
I just hit connect and then made a new database called "timesheet1".
Now it is time to connect via vb.net.
I went to www.connectionstrings.com and got this string:
Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;
I have tried all of the following:
Data Source=PGUNNEWIEK-TM77\SQLEXPRESS;Initial Catalog=timesheet1;User Id=C3BRESLAU\pgunnewiek; Password=aTest1!;
Data Source=PGUNNEWIEK-TM77\SQLEXPRESS;Initial Catalog=timesheet1;User Id=C3BRESLAU\pgunnewiek;
Data Source=PGUNNEWIEK-TM77\SQLEXPRESS;Initial Catalog=timesheet1;User Id=pgunnewiek;
Every time I get login failed.
I have never worked with SQL before so I am not sure what I am doing wrong.
The code I am using is from a codebank example on these forums. It can be seen below:
Code:Imports System.Data.SqlClient Module Module1 Sub Main() Dim ConnectionString = "PGUNNEWIEK-TM77\SQLEXPRESS;Initial Catalog=timesheet1;User Id=C3BRESLAU\pgunnewiek; Password=aTest1!;" ' Check if the Employee is already in the Database Using connection As New SqlConnection(ConnectionString) Using command As New SqlCommand("SELECT NameFirst, NameLast FROM Employees", _ connection) connection.Open() Using reader As SqlDataReader = command.ExecuteReader() While reader.Read() Console.WriteLine(reader) End While End Using End Using End Using End Sub End Module





Reply With Quote