Imports System.Data.SqlClient Partial Class main Inherits System.Web.UI.Page Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load Dim ConnectionString As String = System.Web.Configuration.WebConfigurationManager.ConnectionStrings("dbconn").ToString() Dim dateval As DateTime = Now.Date.ToString Dim MyConn As New System.Data.SqlClient.SqlConnection(ConnectionString) Dim MyComm As New System.Data.SqlClient.SqlCommand("SELECT * FROM [dbo].[doctime] WHERE date= " + "'" + dateval + "'", MyConn) MyConn.Open() Dim DataReader As System.Data.SqlClient.SqlDataReader = MyComm.ExecuteReader() 'Dim format As String = "MM/DD/YY" While (DataReader.Read()) date_label.Text = DataReader("Date") 'box1_lbdate_1.Text = dateval.ToString Doc1name.Text = DataReader("Doc1_Name").ToString Doc1time.Text = DataReader("doc1_time").ToString Doc2name.Text = DataReader("doc2_name").ToString Doc2time.Text = DataReader("doc2_time").ToString If String.IsNullOrWhiteSpace(Doc2name.Text) Then Doc2name.Visible = False Doc2time.Visible = False End If End While DataReader.Close() MyConn.Close() End Sub End Class I keep getting this error [embed=file 900763]
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE