Solved

Pervasive SQL parameter Criteria "?" identifier

Posted on 2009-04-09
2
1,177 Views
Last Modified: 2012-05-06
I am connecting to a Pervaive 10 DB through VS 2008 (dataset)  All is working fine, but when I have more than 1 filter, all I can see is "?" for the paramater prompt.  Is there a way to Identify is like SQL server or Access like "@Param1" <-  does not work BTW.

Thanks.
0
Comment
Question by:vwalla
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 18

Accepted Solution

by:
mirtheil earned 250 total points
ID: 24109300
Nope. PSQL uses the "?" for it's parameter identifier.  
Attached is a code sample using C# and the PSQL ADO.NET provider.


using System;
using Pervasive.Data.SqlClient;
 
namespace PsqlParamTest
{
	class PsqlParamTest
	{
		[STAThread]
		static void Main(string[] args)
		{
			try
			{
				PsqlConnection con = new PsqlConnection("ServerDSN=demodata;ServerName=localhost");
				con.Open();
				PsqlCommand cmd = new PsqlCommand("CREATE TABLE PsqlParamDate ( f1 char(10), f2 LongVarChar)",con);
				int iRes = 0;
				iRes = cmd.ExecuteNonQuery();
				Console.WriteLine("Records affected: {0}",iRes);
				cmd.Dispose();
				PsqlCommand cmd1 = new PsqlCommand("INSERT INTO lvctest (f1,f2) values ( ?,?)",con);
				PsqlParameter param1 = new PsqlParameter("@param1", PsqlDbType.Char);
				param1.Value = "1234";
				cmd1.Parameters.Add(param1);
				PsqlParameter param2 = new PsqlParameter("@param2", PsqlDbType.LongVarChar);
				string sTemp = "";
				sTemp = "Test Value";
				
				param2.Value = sTemp; 
				cmd1.Parameters.Add(param2);
				iRes = cmd1.ExecuteNonQuery();
				Console.WriteLine("Records affected: {0}",iRes);
				cmd1.Dispose();
				con.Close();
				con.Dispose();
			}
			catch (Exception ex)
			{
				Console.WriteLine(ex.ToString());
			}
		}
	}
}

Open in new window

0
 
LVL 1

Author Closing Comment

by:vwalla
ID: 31568610
That's what i thought.  Get's confusing sometimes what order I am putting it all in.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A company’s centralized system that manages user data, security, and distributed resources is often a focus of criminal attention. Active Directory (AD) is no exception. In truth, it’s even more likely to be targeted due to the number of companies …
Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question