sqlparameter Questions

2

Solved

When I add the SQL parameter p to the collection I get an InvalidCastException with the message from the post title. parentId is a nullable integer and a nullable integer in the database. Why do ...
Eubanks asked 30/11, 2012 at 21:38

2

I'm currently trying to write a simple C# wrapper class for all the stored procedures in a database. While building some parameters in C#, I noticed the property SqlParameter.IsNullable and wonde...
Bedroll asked 28/4, 2011 at 16:23

4

Solved

sqlQuery = "SELECT [ID] from [users] WHERE CallerName=@CallerName"; OleDbConnection conn = new OleDbConnection(connectionString); conn.Open(); cmd = new OleDbCommand(sqlQuery, conn); cmd.CommandTe...
Truss asked 27/4, 2012 at 16:34

4

Solved

I have the following line of code: sqlcommand.Parameters.Add("@LinkID", SqlDbType.Int, 4).Value = linkID; But, I'm slightly confused about the use of size. Is this saying that its 4 bytes in siz...
Muir asked 28/2, 2012 at 14:2

2

Solved

I have a web service, so the handler is called multiple times concurrently all the time. Inside I create SqlConnection and SqlCommand. I have to execute about 7 different commands. Different comma...
Peyote asked 21/12, 2011 at 12:52

2

Solved

I observed a strange problem in a piece of code where an adhoc SQL query was not producing the expected output, even though its parameters matched records in the data source. I decided to enter the...
Slavophile asked 2/12, 2011 at 5:48

3

I'm sending a decimal value to a sproc in the following way: SqlParameter meh = new SqlParameter("Foo", SqlDbType.Decimal); meh.Value = "0.00001"; meh.Precision = ((System.Byte)...
Stubbed asked 22/12, 2010 at 11:3

2

Solved

I was doing something like this: SqlParameter param = new SqlParameter("@Param", 0) { SqlDbType = SqlDbType.Int }; private void TestParam(SqlParameter param) { string test = param.Value.ToString...
Nixon asked 18/3, 2011 at 19:23

3

Solved

This is kind of a weird one. I'm looking for ideas on how to ask the right question as much as I am an actual solution. I've got a website and we just had a huge jump in traffic. Now all of the su...
Maryettamaryjane asked 4/1, 2010 at 21:28

1

Solved

Using SqlParameters is a recommended method to prevent SQL Injection in your database queries. Where can I find the code/function that internally sanitizes these parameters? I'd like to re-use this...
Hock asked 29/5, 2009 at 14:2

© 2022 - 2024 — McMap. All rights reserved.