I have looked on the forum and tried everything people have suggested and I cannot find a solution that will make this solution work. The program will run until it has to connect to the database. Then at that point it will bring up the following error: 

> 
> An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll
> 
> 
> Additional information: Incorrect syntax near 'user'.
> 
> 
> 

The `User` being the username in my login page. 

Here is the code I have. Can anyone see any problems I'm missing?

```
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace LoginForm
{
public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
    }

    private void button1_Click(object sender, EventArgs e)
    {
        this.Close();
    }

    private void button2_Click(object sender, EventArgs e)
    {

        SqlConnection con = new SqlConnection(@"Data Source=        (LocalDB)\v11.0;AttachDbFilename=C:\Users\Username\Documents\Data.mdf;Integrated Security=True;Connect      Timeout=30");
        SqlDataAdapter sda = new SqlDataAdapter("Select Count(*) From Login where Username'"     +textBox1.Text + "' and Password ='"+textBox2.Text+"'",con);
        DataTable dt = new DataTable();
        sda.Fill(dt);
        if(dt.Rows[0][0].ToString() == "1")
        {
            this.Hide();
            Main ss = new Main();
            ss.Show();
        }
        else
        {
            MessageBox.Show("please check Username and Password and try again.");
        }
    }
}

```