<%# LCase(DateTime.Parse(DataBinder.Eval(dvProgramGrid, "[0].startTime")).ToString("htt")) %>
This works perfectly in my ASPX page, but when I put it in a user control I get the following error:
String reference not set to an instance of a String. Parameter name: s
Exception Details: System.ArgumentNullException: String reference not set to an instance of a String. Parameter name: s
I don't understand what's going on? Any help would be appreciated!Where is dvProgramGrid defined?
Thanks for your reply. Here is the code for the dataset and dataview:
Dim dsProgramGrid As DataSet
Dim dvProgramGrid As DataView
Dim startTime as string
Dim endTime as string
Sub Page_Load(Src As Object, E As EventArgs)
Dim conJSmenu As OleDbConnection
Dim dadJSmenu As OleDbDataAdapterdsProgramGrid = New DataSet()
conJSmenu = New OleDbConnection( "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\FTP\jgreenly\database\programGrid.mdb" )
dadJSmenu = New OleDbDataAdapter( "SELECT * FROM programGrid WHERE wkdy = ? AND startTime < ? ORDER BY startTime DESC", conJSmenu )
dadJSmenu.SelectCommand.Parameters.Add("@.wkdy", System.DateTime.Now.DayOfWeek.ToString)
dadJSmenu.SelectCommand.Parameters.Add("@.startTime", System.DateTime.Now.ToString("HH:mm"))
dadJSmenu.Fill( dsProgramGrid, "programGrid" )
dvProgramGrid = New DataView(dsProgramGrid.Tables("programGrid"))
Page.DataBind()
End Sub
0 comments:
Post a Comment