Step1: Open SQL SERVER 2005
Step2: Create an empty database
Step3: Go to tables and then create an empty table
Let's consider table name as login, the table is look like
Step2: Create an empty database
Step3: Go to tables and then create an empty table
Let's consider table name as login, the table is look like
Click on Tables
|
Programmability
|
Stored Procedure
|
Create new stored procedure
|
Programmability
|
Stored Procedure
|
Create new stored procedure
Step4:create procedure sp_insert(@sno varchar(10), @ sname varchar(10))
as
begin
insert into emp values(@eid,@ename,@esal)
end
Step5: Now open Visual Studio create new website.
Step6: In code behind file write
as
begin
insert into emp values(@eid,@ename,@esal)
end
Step5: Now open Visual Studio create new website.
Step6: In code behind file write
SqlConnection con;
SqlCommand comm;
con = new SqlConnection("Data Source=BASHA;Initial Catalog=prasad;Integrated Security=True");
con.Open();
comm = new SqlCommand("sp_insert", con);
comm.CommandType =CommandType .StoredProcedure ;
comm.Parameters .AddWithValue ("@eid",TextBox1 .Text );
comm .Parameters .AddWithValue ("@ename",TextBox2 .Text );
comm .Parameters .AddWithValue ("@esal",TextBox3 .Text );
comm.ExecuteNonQuery ();
Response.Write("inserted successfully");
SqlCommand comm;
con = new SqlConnection("Data Source=BASHA;Initial Catalog=prasad;Integrated Security=True");
con.Open();
comm = new SqlCommand("sp_insert", con);
comm.CommandType =CommandType .StoredProcedure ;
comm.Parameters .AddWithValue ("@eid",TextBox1 .Text );
comm .Parameters .AddWithValue ("@ename",TextBox2 .Text );
comm .Parameters .AddWithValue ("@esal",TextBox3 .Text );
comm.ExecuteNonQuery ();
Response.Write("inserted successfully");
Comments
Post a Comment