oledbparameter

What looks wrong in this?

private int DBUpdate() { DAL dal = new DAL(); string upd = "UPDATE [RPform] SET [ProjectName] = '@pname', [ProjectCode] = '@pcode', [Country] = @cnt, "; upd += "[StartDate] = '@startdate', [FinishDate] = '@finishdate', [TotalParticipants] = @totpart, [ArrivalDate] = '@arrivedate', "; upd += "[AirportTransfer] = @airtran, [AirportDat...

dotNET OleDbParameter's name obsession

Since OleDbParameter thing does not use named parameters, (due to its nature) why is the .NEt OleDbParameter classes obsession with (string parametername ... All constructors require a parameter name, and I think what name to give it .. my name is ok? or my grandmothers name? ...

Null Reference Exception

This code generates and Null Reference exception. Exception comes at the line where the parameter array is initialized. What can be the problem? I don't know howto follow the stack-trace and work any logic over it. thanks in advance. DAL dal = new DAL(); string SQL = @"INSERT INTO Assets ([AssetName],[AssetType],[Model],[De...

pass null parameter to SQL server query

How can I pass a null parameter to a SQL server query. I have a simple table with a nullable int column. If I pass a .NET null value, I get a sql error. If I pass DBNull.Value, no row matches the filter. Is there a simple way to do this without using ISNULL. OleDbConnection connection = new OleDbConnection(); connection.Connecti...

Clearing OleDbDataReader parameters

Hi guys, In order to do my stuff, I query the database (Access) to see if my data is already there. So, I'm using a OleDbDataReader. Everything is fine at this moment. Next, depending on the result of my query, I'm doing an insert or and update. The problem is, this operation is using the same parameters (OleDbParameters) that I was us...

OleDbParameters and Parameter Names

Hi, I have an SQL statement that I'm executing through OleDb, the statement is something like this: INSERT INTO mytable (name, dept) VALUES (@name, @dept); I'm adding parameters to the OleDbCommand like this: OleDbCommand Command = new OleDbCommand(); Command.Connection = Connection; OleDbParameter Parameter1 = new OleDbParameter()...