Reid,
It's hard for me to help you without teaching you a lot about SQL Server and ADO.NET. I have a hard time doing that in this kind of message forum.
The bottom line is that you do need to create a parameterized stored procedure that accepts the username as an input parameter. Before calling this proc in
VB, you need to set the value of the parameter.
Since I was already looking at Categories.
vb to answer another question, go to that file and examine the code to create parameters:
Dim parameters As SqlParameter() = { _
New SqlParameter("@CategoryName", SqlDbType.VarChar, 100), _
New SqlParameter("@CategoryImageUrl", SqlDbType.VarChar, 100), _
New SqlParameter("@CategoryPosition", SqlDbType.Int, 4), _
New SqlParameter("@CategoryID", SqlDbType.Int, 4)}
' Set the values
parameters(0).Value = categoryName.Trim()
parameters(1).Value = categoryImageUrl.Trim()
parameters(2).Value = categoryPosition
parameters(3).Direction = ParameterDirection.Output
' Run the procedure
RunProcedure("sp_Forums_InsertCategory", parameters, rowsAffected)
You really should get an intro book on
VB.NET to help you understand the fundamentals. This book on ThePhile is not intended for beginners, and you'll be frustrated if you keep trying to learn the basics from this book.
Please understand that we all had to start out as beginners. I had this book sitting around for several months while I studied other material so I could come back to this book and understand it better.
I think you'd love the Mike Gunderloy book on the 70-305 ASP.NET certification. My son is using this book now and he loves it. He has no background in web programming, but he can follow this book because it has a lot of small step-by-step examples.
Eric