tehon3299
Well-known member
This is my code:
I am calling this function by saying UpdateDB() and for some reason its not putting anything in my SQL table. I am putting the filename is a session variable in a global.asax. Whats wrong with this code??
Code:
Sub UpdateDB()
Dim MyCommand As New SqlCommand
Dim MyConnection As New SqlConnection
Dim MySQLDataAdapter as New SqlDataAdapter
Dim SessionCmd As String
Dim File as String
File = Session("sFileName")
MyConnection = New SqlConnection("server=(local);database=SongShare;Trusted_Connection=yes")
SessionCmd = "INSERT INTO tmSongs FileName VALUES (" & File & ")"
MyCommand = New SqlCommand(SessionCmd, MyConnection)
End Sub
I am calling this function by saying UpdateDB() and for some reason its not putting anything in my SQL table. I am putting the filename is a session variable in a global.asax. Whats wrong with this code??