kanuri1 -2 Junior Poster in Training

hi,
its very urgent for me,
hi ,
i wants to show the label when status='C' and 'F' (selected from the database)
here i want to show the label message as like "rooms 2 (status ='C' ) and 3 (status='F') are free" by using database conditions.........
here iam using sqlserver as database..........
pls help me urgent.............
here my coding is given below

Partial Class check_availability
    Inherits System.Web.UI.Page
    Dim conn As New SqlConnection(ConfigurationManager.ConnectionStrings("guest1").ConnectionString())
    Dim adp, adp1, adp2 As SqlDataAdapter
    Dim ds As New DataSet

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles check.Click
        Dim b As Boolean
        b = False
        Try
            If (arrivaldate.Text = "") Then
                b = True
                MsgBox("select date")
            Else
                Call fillgrid()
            End If
        Catch
            Dim str
            str = "select status from guesthouse where satus='C' and 'F'"
            adp = New SqlDataAdapter(str, conn)
            Label3.Visible = True
            Label3.Text = "rooms are free"
        End Try
        
    End Sub

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

           If Not Page.IsPostBack Then
            Call fillgrid()

        End If

        body.Attributes.Add("onLoad", "window.setTimeout(""window.location.href='home.aspx'"",300000);")

    End Sub

    Private Sub fillgrid()
        Dim str
        str = "select room_no as 'ROOM NO', convert(varchar(11),date_of_arr,106) as 'ARRIVALDATE' , convert(varchar(11),date_of_dept,106) as 'DEPARTUREDATE',convert(varchar,datediff(dd,date_of_arr,date_of_dept) ,100) as 'DAYS' ,status as 'STATUS' from guesthouse  WHERE date_of_arr <= CONVERT(datetime,'" & arrivaldate.Text & "',101) and date_of_dept >= CONVERT(datetime,'" & arrivaldate.Text & "',101) and status = 'O'"
        'Response.Write(str)
        adp = New SqlDataAdapter(str, conn)
        adp.Fill(ds, "guesthouse")
        GridView1.DataSource = ds
        GridView1.DataBind()
        GridView1.Dispose()
    End Sub
End Class
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.