I'm creating a money flow program in Winform. Now i have to bind textbox to Service-Based DataBase (LocalDB) but it gives error (System.Data.SqlClient.SqlException: 'Incorrect syntax near ')'.').I'm not fimiliar with databases so i don't know how to code but im using this
private void addButton_Click(object sender, EventArgs e)
{
if (ComboBox1.SelectedIndex == 1)
{
SqlConnection sc = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\dotex\Desktop\tst\Manager\Manager\ManagerFile\MoneyTransactionsFile\MoneyMovements\MoneyMovementDataBase\moneydatabase.mdf;Integrated Security=True");
sc.Open();
SqlCommand sd = new SqlCommand("insert into Name(@AddedMoney)", sc);
sd.Parameters.AddWithValue("@AddedMoney", TextBox.Text);
sd.ExecuteNonQuery();// this line gives the error
sc.Close();
}
Else
{
}
This is a photo of my database for now. photo If u need any information to fix just write comment.