I'm working on a project of school but im getting an error:
"Keyword not supported: 'integrated security'" Can someone help me with this?
Here is a picuture: http://gyazo.com/5a16cde702601e20c811339c01b1911c
Language: Dutch
Code:
private void button1_Click(object sender, EventArgs e)
{
try
{
string database = @"Data Source=(LocalDB)\v11.0;AttachDbFilename=E:\gip_stap_2\loonberekening.mdf;Integrated Security=True;Connect Timeout=30;InitialCatalog=loonberekening";
SqlConnection myConn = new SqlConnection(database);
SqlCommand Selectcommand = new SqlCommand("select * from loonberekening.tblInloggen where id = '" + this.txtGebruikersnaam.Text + "' and passwoord= '" + this.txtPaswoord.Text + "' ;", myConn);
SqlDataReader myReader;
myConn.Open();
myReader = Selectcommand.ExecuteReader();
int count = 0;
while (myReader.Read())
{
count = count + 1;
}
if (count == 1)
{
MessageBox.Show("Gebruikersnaam en paswoord is correct");
startmenu.ShowDialog();
}
else if (count > 1)
{
MessageBox.Show("Dit is een gedupliceerde paswoord en gebruikersnaam... Acces verboden");
}
else
{
MessageBox.Show("Username and paswoord zijn niet correct, Probeer opnieuw");
myConn.Close();
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}