我是编码界的新手,
我建立了一个带有几个文本框的大型网站,所以现在我发现我一直在使用一种危险的方法在 SQL 服务器中插入数据,如下所示:
execSQL("insert into Dossier(ID_Dossier,Nom_Giac) values(" & id_dossier.text & "," Nom_gaic.text & "')")
Public Function execSQL(ByVal req As String, Optional ByVal type As String = "r")
cmd = New SqlCommand
cmd.CommandText = req
cmd.Connection = con
openCon()
If type = "r" Then
Return cmd.ExecuteReader(CommandBehavior.CloseConnection)
Else
Return cmd.ExecuteNonQuery
End If
End Function
我只是想知道使用 LINQ to SQL 是否可以帮助解决我整个网站中的这个问题。为了使用它,我正在学习这门课程:
http://www.upsizing.co.uk/Art34_IntergratingASPSecurity.aspx