[Mono-list] Connecting to a database (VB)
monkey at jpobst.com
Sun Oct 31 12:50:10 EDT 2010
I am pretty sure Mono does not support integrated security (as it
requires Active Directory).
You will need to put your SQL Server in mixed mode security, create the
username and password in SQL that you want, and give the user
permissions to the appropriate role/database/etc.
On 10/31/2010 10:16 AM, Paul F. Johnson wrote:
> I have set up a really simple MS SQL database and am trying to connect
> to it using VB.
> Currently, my code looks like this
> Dim connstr as String = "Data Source=localhost\SQLEXPRESS;"+"Initial
> Catalog="Database1\Table1;"+"Integrated Security=SSPI;"
> Dim sql as String = Nothing
> Dim tables as New ArrayList
> Dim sqldata as new DataSet
> Dim connect as new SqlConnection(connstr)
> Dim sqlcomm as new SqlCommand(sql, connect)
> sqlcomm.CommandText = "Select Name where (Age> 25 and Hometown =
> Dim sqlad = new SqlDataAdapter
> sqlad.SelectCommand = sqlcomm
> For i = 0 to 3
> sqlad.TableMappings.Add("Table", tables(i).ToString())
> Catch ex as SqlException
> WriteLine("Error " + ex.Message.ToString())
> End Try
> Nothing amazing. The problem is the connection string - I've googled
> around and nothing seems to fit. The exception thrown is that it can't
> log in for user pb5\paul. If I add User Id=paul or User Id=pb5\paul, it
> still won't connect.
> What is wrong?
More information about the Mono-list