Link to home
Start Free TrialLog in
Avatar of G0ggy
G0ggyFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Multi-part identifier could not be bound

Hi all,

I'm getting a multi-part identifier on this code, but I'm flumoxed as to why. The control is dynamic from the gridview and the new filename is correct as I have tested the value of newFileName.

TIA.
Dim con As New SqlConnection(ConnectionStrings("dev").ConnectionString)
 
        Dim row As GridViewRow = gvwCurrentMaterial.Rows(e.RowIndex)
        Dim newFilename As String = CType(row.Cells(2).Controls(0), TextBox).Text
 
        Dim cmd As New SqlCommand("Update dbo.trn_fileSystemCourseMaterials Set originalFilename =" & newFilename & _
            " Where materialsID =" & Convert.ToInt32(Request.Cookies("courseid").Value), con)
 
        cmd.CommandType = CommandType.Text
        con.Open()
        cmd.ExecuteNonQuery()
        con.Close()
        populateCurrentCourseMaterial(Convert.ToInt32(Request.Cookies("courseid").Value))

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial