hi jerry thanks for dropdownlist, but i got another problem regarding updatating a profile of a login member, i created a storedprocedure for login information just look at my codding
CREATE PROCEDURE sp_UserValidation
(
@Username varchar(50),
@UserPassword varchar(20)
)
AS
IF EXISTS (SELECT UserName FROM LogIn1 WHERE UserName=@Username and UserPassword=@UserPassword)
BEGIN
return 1
END
ELSE
BEGIN
return 0
END
create table login1(username varchar(50)constraint pkusername primary key,userpassword varchar(20) ,
youranswer varchar(40),username varchar(20), useraddress varchar(100),usercity varchar(20),userpostal int,
userphone int,usermobile int,Email varchar(30),website varchar(30))CREATE PROCEDURE sp_UserValidation
(
@Username varchar(50),
@UserPassword varchar(20)
)
AS
IF EXISTS (SELECT UserName FROM LogIn1 WHERE UserName=@Username and UserPassword=@UserPassword)
BEGIN
return 1
END
ELSE
BEGIN
return 0
END
create table login1(username varchar(50)constraint pkusername primary key,userpassword varchar(20) ,
youranswer varchar(40),username varchar(20), useraddress varchar(100),usercity varchar(20),userpostal int,
userphone int,usermobile int,Email varchar(30),website varchar(30))
my problem is i want to update some of login member column but iam not able to update, i wrote some coding for that just go through that,
(Toggle Plain Text)
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection("user id=sa;password=vubrain;database=raghu;data source=vubrain4");
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandText = "Update login1001 Set name = @username1001, pwd = @userpassword1001 where username1001= @username1001";
cmd.CommandType = CommandType.Text;
SqlParameter para2;
SqlParameter para3;
SqlParameter para4;
SqlParameter para5;
//SqlParameter para6;
SqlParameter para7;
SqlParameter para8;
SqlParameter para9;
para2 = cmd.@Parameters.AddWithValue("loginaddress", tb1.Text);
para3 = cmd.@Parameters.AddWithValue("logincity", t6.Text);
para4 = cmd.@Parameters.AddWithValue("loginpostalcode", t7.Text);
para5 = cmd.@Parameters.AddWithValue("loginphone", t8.Text);
//para6 = cmd.Parameters.AddWithValue("loginfax", t9.Text);
para7 = cmd.@Parameters.AddWithValue("loginmobile", t10.Text);
para8 = cmd.@Parameters.AddWithValue("loginemail", t11.Text);
para9 = cmd.@Parameters.AddWithValue("loginwebsite", t12.Text);
int intnum;
con.Open();
intnum = cmd.ExecuteNonQuery();
if (intnum > 0)
{
Label2.Text = "updated successfully";
}
else
{
Label2.Text = "updarted failed";
}
con.Close(); protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection("user id=sa;password=vubrain;database=raghu;data source=vubrain4");
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandText = "Update login1001 Set name = @username1001, pwd = @userpassword1001 where username1001= @username1001";
cmd.CommandType = CommandType.Text;
SqlParameter para2;
SqlParameter para3;
SqlParameter para4;
SqlParameter para5;
//SqlParameter para6;
SqlParameter para7;
SqlParameter para8;
SqlParameter para9;
para2 = cmd.@Parameters.AddWithValue("loginaddress", tb1.Text);
para3 = cmd.@Parameters.AddWithValue("logincity", t6.Text);
para4 = cmd.@Parameters.AddWithValue("loginpostalcode", t7.Text);
para5 = cmd.@Parameters.AddWithValue("loginphone", t8.Text);
//para6 = cmd.Parameters.AddWithValue("loginfax", t9.Text);
para7 = cmd.@Parameters.AddWithValue("loginmobile", t10.Text);
para8 = cmd.@Parameters.AddWithValue("loginemail", t11.Text);
para9 = cmd.@Parameters.AddWithValue("loginwebsite", t12.Text);
int intnum;
con.Open();
intnum = cmd.ExecuteNonQuery();
if (intnum > 0)
{
Label2.Text = "updated successfully";
}
else
{
Label2.Text = "updarted failed";
}
con.Close();
please sought out my problem
thank you
raghu