异常详细信息: System.ArgumentException: 列“type”不属于表 vod。
源错误:
行 129: Dim row As DataRow = DataSet1.Tables("vod").NewRow
行 130: row("name") = fileName
行 131: row("type") = fileType
行 132: row("path") = filePath
行 133: row("url") = fileUrl
源程序:
fileName = Path.GetFileNameWithoutExtension(files.Name)
fileType = Path.GetExtension(files.Name)
filePath = urlCanshu
Response.Write("<br>")
a = Mid(filePath, Len(rootDir) + 1, Len(filePath) - Len(rootDir))
urlPath = Replace(a, "\", "/")
urlName = fileName & fileType
fileUrl = urlIp & urlPath & urlName
fileTime = File.GetLastWriteTime(filePath & fileName & fileType)
Dim row As DataRow = DataSet1.Tables("vod").NewRow
row("name") = fileName
row("type") = fileType
row("path") = filePath
row("url") = fileUrl
row("time") = fileTime
row("click") = 0
DataSet1.Tables("vod").Rows.Add(row)
SqlDataAdapter1.Update(DataSet1, "vod")
row.AcceptChanges()
我的数据库中的vod的表定义的就是type列是char
SqlCommand1.CommandText = "SELECT * FROM vod WHERE (vname = " & files.Name & " )"