G
Guest
This is related to a post below but is a new issue.
I have created a SQLDataAdaptor from the config wizard and set my
SQLConnection1 in same wizard. I then gerated a dataset from my adaptor as
all the notes tell you to do.
I load the form and code the following to see if the connection is open.
Try
MessageBox.Show(SqlConnection1.State.ToString) -- closed
SqlConnection1.Open()
MessageBox.Show(SqlConnection1.State.ToString) -- fails with ex as below
SqlDataAdapter2.Fill(DataSet11)
dgThreshold.DataSource = DataSet11.DefaultViewManager
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
ex returns as (even though the TEST Connection button worked and you can see
it's connected vis the server explorer)
System.Data.SqlClient.SQLException: Login failed for user 'sa'.
at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean&
isInTransaction)
at System.Data.SqlClient.SQLConnectionPoolManager.GetPooledConnection
(SqlConnection String options, Boolean& isInTransaction)
at System.Data.SqlClient.SqlConnection.Open()
at MIS_RECON_Engine.Thresholds.Thresholds_Load(object sender, EventArgs e)
in C:\Documents and settings.....Thresholds.vb:Line 349
I have created a SQLDataAdaptor from the config wizard and set my
SQLConnection1 in same wizard. I then gerated a dataset from my adaptor as
all the notes tell you to do.
I load the form and code the following to see if the connection is open.
Try
MessageBox.Show(SqlConnection1.State.ToString) -- closed
SqlConnection1.Open()
MessageBox.Show(SqlConnection1.State.ToString) -- fails with ex as below
SqlDataAdapter2.Fill(DataSet11)
dgThreshold.DataSource = DataSet11.DefaultViewManager
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
ex returns as (even though the TEST Connection button worked and you can see
it's connected vis the server explorer)
System.Data.SqlClient.SQLException: Login failed for user 'sa'.
at System.Data.SqlClient.ConnectionPool.GetConnection(Boolean&
isInTransaction)
at System.Data.SqlClient.SQLConnectionPoolManager.GetPooledConnection
(SqlConnection String options, Boolean& isInTransaction)
at System.Data.SqlClient.SqlConnection.Open()
at MIS_RECON_Engine.Thresholds.Thresholds_Load(object sender, EventArgs e)
in C:\Documents and settings.....Thresholds.vb:Line 349