OK, one last thing. Now I have 3 textboxes and here's what I wrote:

SqlConnection conn = new SqlConnection();
        conn.ConnectionString = "data source=.;initial catalog=ForumDataBase;integrated security=true;";
        SqlCommand cmd = new SqlCommand();
        cmd.CommandText = "INSERT INTO PostTable(ThreadTitle,PostMessage,UserName)
        values('"+ThreadTextBox.Value+"','"+PostTextBox.Value+"','"+NameTextBox.Value+"')";
        cmd.Connection = conn;
        conn.Open();
        cmd.ExecuteNonQuery();
        conn.Close();

Can you please tell me what's wrong with the INSERT INTO statement? I'm kinda confused with all these single and double quotation marks etc. Or maybe the connectionString has some problems?

Never mind. I foud the solution ;)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.