Public Sub UpdateChat() 'Getting the connection string Dim connectString As String = ConfigurationManager.ConnectionStrings("ShoutDb").ConnectionString 'Creating connection object Dim connect As SqlConnection = New SqlConnection(connectString) 'Declaring variable to store sqlcommand Dim command As New SqlCommand 'Initialising the sql command to the varaible command.CommandText = "INSERT INTO [ShoutBox].[dbo].[CommonShout]([UserName],[Message],[SubmitTime]) VALUES('" & Session("UserName").ToString & "','" & smiley() & "',Convert(datetime,'" & DateTime.Now.ToString & "',120))" 'Connecting to database connect.Open() 'Connecting the sql command with the database. command.Connection = connect command.ExecuteNonQuery() LoadChatData() Me.TxtMessage.Text = String.Empty End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)