Questions tagged [oledbparameter]

23 questions
0
votes
1 answer

querying a database using a date parameter

I am new to Visual Basic as well as Stackoverflow. I am querying certain fields from a database but receiving an error. here's my code: Dim fifdate As Date = Now() fifdate.AddDays(-15) db.AddParam("collected", "N") db.AddParam("printed",…
bigboi214
  • 21
  • 4
0
votes
2 answers

c# Oledb add list of parameters in a foreach loop

i write an application that creates an excel file with OleDb, the problem is that when the program runs a foreach loop it writes always the same data in the row, not the different value of the object in the loop. The code is: foreach(var user in…
pampua84
  • 696
  • 10
  • 33
0
votes
7 answers

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] =…
emre
0
votes
0 answers

Only one OleDBParemeter is replaced in SQL Query

I am currently working on accessing a database using OleDB and I am having issue with string replacement of OleDBParameter. using (OleDbCommand cmd = conn.CreateCommand()) { cmd.CommandText = "SELECT * FROM " + tablename + " WHERE ID = @ID ;"; …
Jeph Gagnon
  • 157
  • 3
  • 13
0
votes
0 answers

How to set DbParameter value as default. Like we set default in sql insert statement

I know we can set DBnull value to DbParameter like dbParameter.Value = DBNull.Value; Similarly can I set 'default' to DbParameter when I pass parameters to my DbAdapter? Thanks
Venu
  • 184
  • 3
  • 14
0
votes
1 answer

OleDBParameterCollection only accepts non null values OleDbparmeter type objects

lala.Parameters.Add(new OleDbParameter("@Base", OleDbType.SmallInt).Value = textBox15.Text); textBox15.Text = reader["@Base"].ToString(); The following error occurs in the first line of code OleDBParameterCollection only accepts non null values…
john cenator
  • 33
  • 2
  • 7
0
votes
1 answer

Getting a value from a SQL Function using ParameterDirection

This is the SQL Function: create or replace FUNCTION "TEMPXML" ( ID IN NUMBER ) RETURN CLOB IS val CLOB; BEGIN val:=null; BEGIN SELECT TEMPID INTO val FROM TEMPDATA WHERE TempdataID=I; exception when no_data_found then null; end; return…
Roniu
  • 79
  • 10
-2
votes
1 answer

Serializing System.Data.OleDb.OleDbParameter[] not working with Newtonsoft.Json

I'm implementing an abstraction layer between client software and a database. The software was originally written using OleDb and it's working well. We already deal with data access through a Data component but the client software still calls its…
DinahMoeHumm
  • 185
  • 10
1
2