i taken the three textboxes and one button to store the data in sqlserver .but the it giving the error.
the code is as follows...
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class Default3 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection("user id=sa;password=vikram;database=kran");
SqlCommand cmd = new SqlCommand("select * from dr", con);
SqlDataReader dr;
// cmd.CommandText = "select * from dr";
cmd.Connection = con;
con.Open();
dr = cmd.ExecuteReader();
cmd.CommandText="insert into dr values("&TextBox1.Text&", ' " &TextBox2.Text&" ', ' " &TextBox3.Text&" ')";
TextBox1.Text=" ";
TextBox2.Text= " ";
TextBox3.Text=" ";
dr.Close();
con.Close();
}
protected void Button1_Click(object sender, EventArgs e)
{
}
}
i written the code like that .please clarify my application..
if it is not correct please tel me the correct...