namespace sqlconnecttest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
SqlConnection myConnection = new SqlConnection("user id=name" +
"password=pass;server=http://www.mywebsite.co.uk;" +
"Trusted_Connection=yes;" +
"database=mydb; " +
"connection timeout=30");
try
{
myConnection.Open();
}
catch (Exception f)
{
MessageBox.Show(f.ToString());
}
}
}
}
The messagebox always shows, with a massive error string in it, about it not being found.
I'm usualll doing something fundamentally wrong.
I'd appreciate any hints.
edit. sorry but the code came out all wierd.