make sure all queries are parameterised like this: sql = ("select * from contacts where contactid = @id") Dim cmd As SqlCommand = New SqlCommand(sql, conn) cmd.Parameters.Add("@id", SqlDbType.VarChar) cmd.Parameters("@id").Value = id I also include a usercontrol which checks the querystring for bad terms: The list is long but this snippet should give you the gist of it: Dim querystringvar As String = Request.QueryString.ToString If InStr(querystringvar, "drop") Then Response.Redirect("/errors/... ......
Here is the code you need to start adding parameters to your sql commands:
Add parameter then add value:
Dim cmd As SqlCommand = New SqlCommand(s,c)
cmd.Parameters.Add("@id", SqlDbType.Int)
cmd.Parameters("@id").Value = foo
or
Add parameter with value:
command.Parameters.AddWithValue("@id", foo)
The solution to the problem I was having in my post earlier this morning: A lurking instance of "Visual C# 2008" was installed on my machine and not updated to SP1 level. After replacing this with the current version (from http://www.microsoft.com/ex... and re-running the test, SQL server 2008 is now installing ok. A useful blog post from msdn on this subject can be found here: http://bit.ly/483su6 ......
Well this morning I've been trying to mirror the office's development environment onto an offline laptop. Correct me if I am wrong, but version ".0.30729.1 SP" includes the service pack 1 update (dont get me started on the mission of creating a full version of the installer/downloader to run offline) . So when I try to setup a new SQL Server 2008 instance why do I fail the test "Previous releases of Microsoft Visual Studio 2008" ... Most support web sites suggest re-installing SP1, which I have done ......
My name is Phil, im from the UK. Currently I'm going through a career change, working in South Africa as a Junior asp.net developer. For the most part I will be coding in VB rather than C# as that is what the organisation I'm working for use. My own background is in web publishing, content management and taxonomies where I have around 10 years experience working in London, Liverpool, New York and South Africa for many high profile clients such as; Save the Children Her Majesty's Court Service The ......