Click here to Skip to main content
15,907,913 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Help with RSS feed C# [modified] Pin
i gr825-Feb-10 19:36
i gr825-Feb-10 19:36 
Questionlist item Pin
FEMDEV25-Feb-10 3:07
FEMDEV25-Feb-10 3:07 
Questionhow to publish website through IIS Pin
hi_everybody25-Feb-10 2:27
hi_everybody25-Feb-10 2:27 
AnswerRe: how to publish website through IIS Pin
R. Giskard Reventlov25-Feb-10 2:47
R. Giskard Reventlov25-Feb-10 2:47 
AnswerRe: how to publish website through IIS Pin
Abhijit Jana25-Feb-10 3:19
professionalAbhijit Jana25-Feb-10 3:19 
AnswerRe: how to publish website through IIS Pin
Brij25-Feb-10 6:25
mentorBrij25-Feb-10 6:25 
GeneralRe: how to publish website through IIS Pin
hi_everybody25-Feb-10 19:49
hi_everybody25-Feb-10 19:49 
QuestionNo results.. please try again message Pin
DaithiBoo25-Feb-10 1:02
DaithiBoo25-Feb-10 1:02 
Hi there.. Smile | :)

im workin on a website at the moment in asp.net, using vb.net, in the visual studios 2008 IDE! i just wish to add an extra feature and hopefully someone out there might be able to help.
I have a button that reads the values of 5 radio buttons in a radiobutton list, then queries the database, returning results based on the values selected. If no value is returned i wish to display a message saying "No Results this time, please search again" or something to that effect. Im not sure how to do this. here is the code i have behind the button.. Please advise.

Protected Sub btnSuggest_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSuggest.Click

Dim myConnection As SqlConnection
Dim myCommand As SqlCommand
Dim dr As SqlDataReader
Dim varBatteryLifeQ As String = ""
Dim varMemoryQ As String = ""
Dim varRam As String = ""
Dim varScreenSize As String = ""
Dim varWebcam As String = ""



myConnection = New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True")

myConnection.Open()

varBatteryLifeQ = RadioButtonList1.SelectedValue.ToString
varMemoryQ = RadioButtonList2.SelectedValue.ToString
varRam = RadioButtonList3.SelectedValue.ToString
varScreenSize = RadioButtonList4.SelectedValue.ToString
varWebcam = RadioButtonList5.SelectedValue.ToString


myCommand = New SqlCommand("Select * From LPU400 Where BatteryLife = '" + varBatteryLifeQ + "' AND Memory = '" + varMemoryQ + "' AND RAM ='" + varRam + "' AND ScreenSize ='" + varScreenSize + "' AND Webcam ='" + varWebcam + "'", myConnection)
SqlDataSource2.SelectCommand = "Select * From LPU400 Where BatteryLife = '" + varBatteryLifeQ + "' AND Memory = '" + varMemoryQ + "' AND RAMQ ='" + varRam + "' AND ScreenSize ='" + varScreenSize + "' AND Webcam ='" + varWebcam + "'"
SqlDataSource2.DataBind()


dr = myCommand.ExecuteReader()

While dr.Read()


End While

dr.Close()



myConnection.Close()


End Sub

Thanks in advance,

Daithi
AnswerRe: No results.. please try again message Pin
Dinesh Mani25-Feb-10 1:20
Dinesh Mani25-Feb-10 1:20 
GeneralRe: No results.. please try again message Pin
DaithiBoo25-Feb-10 1:47
DaithiBoo25-Feb-10 1:47 
QuestionDynamic Report Designing Pin
Kashif Sabir25-Feb-10 0:43
Kashif Sabir25-Feb-10 0:43 
AnswerRe: Dynamic Report Designing Pin
i gr825-Feb-10 19:31
i gr825-Feb-10 19:31 
Questionneed help for writting javascript for transferring data from one system to another Pin
hi_everybody25-Feb-10 0:28
hi_everybody25-Feb-10 0:28 
Questionthe command is not available because no document is open Pin
vimalkumarsinghal24-Feb-10 23:06
vimalkumarsinghal24-Feb-10 23:06 
AnswerRe: the command is not available because no document is open Pin
Nasri871-Mar-10 21:39
Nasri871-Mar-10 21:39 
QuestionHow do we convert a data from database into XMLfile using asp.net with vb.net Pin
vbmadhavi24-Feb-10 23:05
vbmadhavi24-Feb-10 23:05 
AnswerRe: How do we convert a data from database into XMLfile using asp.net with vb.net Pin
Nuri Ismail25-Feb-10 0:18
Nuri Ismail25-Feb-10 0:18 
GeneralRe: How do we convert a data from database into XMLfile using asp.net with vb.net Pin
Sanjay Jaiswal 123456725-Feb-10 0:32
Sanjay Jaiswal 123456725-Feb-10 0:32 
GeneralRe: How do we convert a data from database into XMLfile using asp.net with vb.net Pin
Nuri Ismail25-Feb-10 0:41
Nuri Ismail25-Feb-10 0:41 
QuestionOnclick Event Pin
Paulraj G24-Feb-10 22:54
Paulraj G24-Feb-10 22:54 
AnswerRe: Onclick Event Pin
R. Giskard Reventlov24-Feb-10 23:24
R. Giskard Reventlov24-Feb-10 23:24 
AnswerRe: Onclick Event Pin
Lokesh Zende25-Feb-10 4:04
professionalLokesh Zende25-Feb-10 4:04 
GeneralRe: Onclick Event Pin
Not Active25-Feb-10 4:12
mentorNot Active25-Feb-10 4:12 
QuestionCannot get checkbox element in Datagrid using javascript in FF Pin
lahari_padigala24-Feb-10 21:09
lahari_padigala24-Feb-10 21:09 
AnswerRe: Cannot get checkbox element in Datagrid using javascript in FF Pin
Chetan Patel24-Feb-10 22:38
Chetan Patel24-Feb-10 22:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.