Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Converting an int into a string in ASP.net (VB.net)
What I'd like to do is pull a integer value from a column in a database and use the reulting value to equal a label's Text property.
What I've got so far is :
GetNumberOfEntries() = NumberOfEntries.Text
Function GetNumberOfEntries() As System.Data.SqlClient.SqlDataReader
Dim connectionString As String = "server='localhost'; user id='sa'; password='password'; Database='ASPExamples'"
Dim sqlConnection As System.Data.SqlClient.SqlConnection = New System.Data.SqlClient.SqlConnection(connectionString)
Dim queryString As String = "SELECT MAX [GuestbookEntries].[GuestBookEntriesID] FROM [GuestbookEntries]"
Dim sqlCommand As System.Data.SqlClient.SqlCommand = New System.Data.SqlClient.SqlCommand(queryString, sqlConnection)
Dim dataReader As System.Data.SqlClient.SqlDataReader = sqlCommand.ExecuteReader(System.Data.CommandBehavior.CloseConnection)
where NumberOfEntries is my label's name. I wonder if someone can help me please as I don't think the value returned by the function is of the right type?
0 · ·