hi
i wants to create an dll file for displaying selected data form database by using a gridview.
for this iam creating a dll file , in that how to declare gridview1 ,,,,
here my codeing is given below .....
please correct errors....
Imports System
Imports Microsoft.VisualBasic
Imports System.Web
Namespace mylib
Public Class gridcalendar 'Displays gridcalendar
Public Function griscal(ByVal dateofarrival As String)
Dim dateofdeparture As String
Dim conn As New SqlClient.SqlConnection("server = 10.160.19.104;address=10.160.19.104;network=DBMSSOCN;database=apcms;User ID=sudhaar;Password=sudhaar")
Dim adp As SqlClient.SqlDataAdapter
Dim ds As New DataSet
Dim str As String
str = "select g.room_no as 'Room No',convert(varchar(11),g.date_of_arr,106) AS 'Arrival Date',convert(varchar(11),g.date_of_dept,106) As 'Departure Date',convert(varchar,datediff(dd,g.date_of_arr,g.date_of_dept)+1 ,100) as 'Days' ,g.status as 'Status', r.total_beds AS 'Beds' from guesthouse g,rooms r WHERE g.status<>'Checkedout' and g.status<>'Cancelled' and month(date_of_arr) between month(CONVERT(datetime,'" & dateofarrival.ToString & "',101)) and month(CONVERT(datetime,'" & dateofdeparture.ToString & "',101))and r.room_no=g.room_no order by g.room_no,g.date_of_arr"
adp = New SqlClient.SqlDataAdapter(str, conn)
adp.Fill(ds, "guesthouse")
GridView1.DataSource = ds
GridView1.Caption = "BOOKING CALENDAR"
GridView1.DataBind()
GridView1.Dispose()
End Function
End Class
End Namespace
thnx.........
please help me.....
thank you........