Sunday, March 21, 2010

Delete data using (DATA SET)ds and dt

It is step3 procedure


Delete Button code

protected void btn_delete_Click(object sender, EventArgs e)
{

datac b = new datac();
b.delete(Convert.ToInt32(TextBox1.Text));
//control of asp.net

Label1.Text = "record deleted";
TextBox1.Text = "";
TextBox2.Text = "";
TextBox3.Text = "";
TextBox4.Text = "";
}






It is step5 procedure.


This class actually work on data here it is work on deleting data


Delete Data class

public void deletemain(Int32 ss)
{
//simple delete query
//To insert data we just change the query.

string query = "delete from student where stu_id=" + ss;

// we can write query using logical operator also.
///////
//connection string

string constring = "Data Source= SHYAM-6E8C5C74B\\SQLEXPRESS ;initial catalog=college;     integrated security=True ";

//Creating Connection

SqlConnection cn = new SqlConnection(constring);

SqlDataAdapter da = new SqlDataAdapter(query, cn);

DataSet ds = new DataSet();

da.Fill(ds);

}


Get 1 Million Hits, FREE!

4 comments:

shyam said...

Keep in touch we will try to make it more useful.

http://sqlclass3.blogspot.com/2010/04/happy-to-help.html

see for more information.

Anonymous said...

buy tramadol online where to buy tramadol safely - tramadol jittery

Anonymous said...

buy tramadol online buy tramadol online next day delivery - tramadol 50 mg bivirkninger

Anonymous said...

tramadol no prescription tramadol for dogs loss of appetite - buy tramadol no prescription cod