Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
kwikwisi
Constraint Violating Yak Guru
283 Posts |
Posted - 2008-04-15 : 05:30:26
|
i have 1 radio button and 1 radio button listi want if userid exist in database ,disable rbnewif not,disable rbltestbut it always disable rbnew whether userid exist or notmy coding is like that:Dim i As Integer Dim userid As String userid = Request.QueryString("userid") Dim con As SqlConnection Dim cmd As SqlCommand Dim strsql As String con = New SqlConnection(ConfigurationSettings.AppSettings("strcon")) strsql = "select * from Table where UserID=" & userid con.Open() cmd = New SqlCommand(strsql, con) i = cmd.ExecuteNonQuery If Not i = 0 Then rbnew.Enabled = False Else rblTest.Enabled = False End If |
|
bbasir
Yak Posting Veteran
76 Posts |
Posted - 2008-04-17 : 13:33:06
|
create a stored proc with an output parameter as well and inside that if there are values set the output parameter inside the stored proc to 1 else 0in c # get the value of that output parameter and if the value si 1 do som ething else if 0 then do some thing else |
|
|
|
|
|