parameterized-query

Missing Required Parameter in Parameterized Query?

佐手、 提交于 2019-12-10 23:39:20
问题 I am getting the following error trying to execute the code below No Value Given For One Or More Required Parameters. string paraName = "CONTROL"; string fullPathToExcel = @"C:\Users\xbbjn2h\Desktop\Mapping.xlsx"; string connString = string.Format(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties=""Excel 12.0 Xml;HDR=YES;""",fullPathToExcel); string sql = "SELECT [FUNCTION],[NAME] from [Sheet1$] WHERE [FUNTION] = ?"; OleDbConnection conn = new OleDbConnection(); conn

Error with simple Parameterized Query - Java/ SQL

落爺英雄遲暮 提交于 2019-12-10 17:25:56
问题 Following on from one of my previous questions to do with method design I was advised to implemented my SQL queries as a parameterized query as opposed to a simple string. I've never used parameterized queries before so I decided to start with something simple, take the following Select statement: String select = "SELECT * FROM ? "; PreparedStatement ps = connection.prepareStatement(select); ps.setString(1, "person"); This gives me the following error: "[SQLITE_ERROR] SQL error or missing

basics of parameterized query

て烟熏妆下的殇ゞ 提交于 2019-12-08 02:29:42
问题 I have used parameterized query number of times I know it helps in preventing SQL injection. But, I was wondering if I can know what is basic logic working inside a parameterized query to prevent SQL injection may be it is very simple but I don't know about it. I tried to search google what are the basic of it but every time I found an example that how to use parameterized query in Asp.net. I know about making a special class which stops those special characters like (',-- etc) which are used

SPARQL parameterized queries

随声附和 提交于 2019-12-07 09:48:31
问题 Good day! I apply rdflib for python. I have a question. How can I put variable into SPARQL's query ? Instead of 'OSPF' in course:OSPF! qres = g.query( """SELECT ?x ?z ?y WHERE { course:OSPF course:termName ?x. course:OSPF ?s ?t. ?s ?d ?z. ?t course:termName ?y. FILTER (regex(?z,"[^a-z]","i") && isLiteral(?z) ) }""" ,initNs=dict(course=Namespace..... @ msalvadores I want enter my Variable by console. --->python parse.py OSPF A value of variable(OSPF) may be another one. How can I initialize it

C# Microsoft Access Parameterized Queries not doing its job

元气小坏坏 提交于 2019-12-07 05:13:42
问题 I have already done research into this, and though the below questions are similar, I have tried them all, but none seems to solve my issue. Proper way of getting a data from an Access Database using parameters inserting data into access database Getting Data from Access into a text box in C# by clicking a button UPDATE query on Access Database not working C#.NET passing parameter to access query from c# Parameterized query for inserting values Here is the part of the code that is relevant:

basics of parameterized query

筅森魡賤 提交于 2019-12-06 08:09:23
I have used parameterized query number of times I know it helps in preventing SQL injection. But, I was wondering if I can know what is basic logic working inside a parameterized query to prevent SQL injection may be it is very simple but I don't know about it. I tried to search google what are the basic of it but every time I found an example that how to use parameterized query in Asp.net. I know about making a special class which stops those special characters like (',-- etc) which are used in SQL injection, but does stopping only special characters totally prevent SQL injection? And one

C# Microsoft Access Parameterized Queries not doing its job

被刻印的时光 ゝ 提交于 2019-12-05 10:23:22
I have already done research into this, and though the below questions are similar, I have tried them all, but none seems to solve my issue. Proper way of getting a data from an Access Database using parameters inserting data into access database Getting Data from Access into a text box in C# by clicking a button UPDATE query on Access Database not working C#.NET passing parameter to access query from c# Parameterized query for inserting values Here is the part of the code that is relevant: private void LoadDetails(int index) { try { connection.Open(); command = new OleDbCommand("SELECT * from

SQLServerCE Problem with parameterized queries from .NET

南笙酒味 提交于 2019-12-03 18:11:33
问题 I am pulling the hair out of my head trying to figure this one out. I can't make Parameterized queries to work in VB.Net, when I am using parameters. From what I have found, using a parameter in a function, from .NET raises an error (see sample code). However, running the not working query in the Query Window in Visual studio works properly. The error raised is: 25922 - The arguments for function are not valid. Info from: http://msdn.microsoft.com/en-us/library/aa256772%28SQL.80%29.aspx

Confusion between prepared statement and parameterized query in Python

一世执手 提交于 2019-12-03 01:37:58
As far as I understand, prepared statements are (mainly) a database feature that allows you to separate parameters from the code that uses such parameters. Example: PREPARE fooplan (int, text, bool, numeric) AS INSERT INTO foo VALUES($1, $2, $3, $4); EXECUTE fooplan(1, 'Hunter Valley', 't', 200.00); A parameterized query substitutes the manual string interpolation, so instead of doing cursor.execute("SELECT FROM tablename WHERE fieldname = %s" % value) we can do cursor.execute("SELECT FROM tablename WHERE fieldname = %s", [value]) Now, it seems that prepared statements are, for the most part,

Escaping apostrophe/single quote in parameterized sql in asp

*爱你&永不变心* 提交于 2019-12-02 16:07:56
问题 I'm new to parametrized SQL. I've got a query in an .asp page that's getting one or more client names from a form. These are held in an array called clientArr and then passed through to SQL server as parameters. I'm escaping the ' as '' but this doesn't appear to be working. If I run the query with a client name like McDonald's , it returns no results. clientArr(y) = Replace(clientArr(y),"'","''" ... if qsClient > "" Then dim booComma booComma = false if mySQLwhere > "" Then mySQLwhere =