My sql syntax for MySQL got problem?

I am trying out dataset. My database is Mysql. I can't seem to preview my data and also a textbox for my to key in something in my parameter. Is there something wrong my sql below?

SELECT clinic.* FROM clinic WHERE (state = '@state')


My HomePage - www.findingsteve.net

"It is more blessed to give than to receive." Acts 20: 35 (NIV, Bible)

Progress - "Never discourage anyone...who continually makes progress, no matter how slow." Plato
0
ngaisteve1
12/20/2006 9:27:42 AM
asp.net.mysql 1929 articles. 0 followers. Follow

13 Replies
412 Views

Similar Articles

[PageSpeed] 27

I don't know anything about MySQL, but as far as SQL goes, you would need to remove the single quotes from your WHERE clause as so:

SELECT clinic.* FROM clinic WHERE (state = @state)


Thanks, Ed

Microsoft MVP - ASP/ASP.NET

0
ecbruck
12/20/2006 3:32:14 PM
Thanks. I tried but still doesn't work.
My HomePage - www.findingsteve.net

"It is more blessed to give than to receive." Acts 20: 35 (NIV, Bible)

Progress - "Never discourage anyone...who continually makes progress, no matter how slow." Plato
0
ngaisteve1
12/20/2006 4:40:49 PM
ngaisteve1:

I am trying out dataset. My database is Mysql. I can't seem to preview my data and also a textbox for my to key in something in my parameter. Is there something wrong my sql below?

SELECT clinic.* FROM clinic WHERE (state = '@state')

Hi, try this (assuming you're inside the clinic database)..

 select * from clinic where state = '@state';


I am a PHP Developer, Now learning ASP.NET. I want to be an ASP.NET Developer soon!
0
lmiranda
12/21/2006 3:31:54 AM
I tried to use SQL database and it works. Now, I need to find way for Mysql database.
My HomePage - www.findingsteve.net

"It is more blessed to give than to receive." Acts 20: 35 (NIV, Bible)

Progress - "Never discourage anyone...who continually makes progress, no matter how slow." Plato
0
ngaisteve1
12/21/2006 7:24:05 AM

ngaisteve1:
I tried to use SQL database and it works. Now, I need to find way for Mysql database.

try my solution, it will work.


I am a PHP Developer, Now learning ASP.NET. I want to be an ASP.NET Developer soon!
0
lmiranda
12/21/2006 8:06:33 AM

Actually, I have no idea how to try your way. Not too familiar with Visual Web Developer 2005 Express Edition yet. How do I try it?

For me, what I did was, I add a new item called "Dataset" and then create a connection to the respective database and use Query Builder to create the query.


My HomePage - www.findingsteve.net

"It is more blessed to give than to receive." Acts 20: 35 (NIV, Bible)

Progress - "Never discourage anyone...who continually makes progress, no matter how slow." Plato
0
ngaisteve1
12/21/2006 8:17:39 AM

Hi

@ is the syntax of sql server .

You could replace @state with ? in mysql.

SELECT clinic.* FROM clinic WHERE (state = ? )


Sincerely,
Young Fang
0
yyy8347
12/25/2006 7:45:52 AM

Is it SELECT clinic.* FROM clinic WHERE (clinic_name = '?clinic_name') ? I tried but still doesn't work.


My HomePage - www.findingsteve.net

"It is more blessed to give than to receive." Acts 20: 35 (NIV, Bible)

Progress - "Never discourage anyone...who continually makes progress, no matter how slow." Plato
0
ngaisteve1
12/26/2006 2:52:14 AM
ngaisteve1:

Is it SELECT clinic.* FROM clinic WHERE (clinic_name = '?clinic_name') ? I tried but still doesn't work.

The link below will help you understand programming MySQL.  Hope this helps.

http://www.databasejournal.com/article.php/1474351


Kind regards,
Gift Peddie
0
Caddre
12/26/2006 3:03:17 AM
I have tried to glance thru a few articles but still couldn't find what I want. Could you point out to me which particular article to read? There are too plenty of them there. Thanks.
My HomePage - www.findingsteve.net

"It is more blessed to give than to receive." Acts 20: 35 (NIV, Bible)

Progress - "Never discourage anyone...who continually makes progress, no matter how slow." Plato
0
ngaisteve1
12/26/2006 6:38:55 AM
ngaisteve1:

Is it SELECT clinic.* FROM clinic WHERE (clinic_name = '?clinic_name') ? I tried but still doesn't work.

It should be something like this:

                OdbcCommand command = new OdbcCommand("SELECT clinic.* FROM clinic WHERE (state = ? )", connection);

                command.Parameters.Add(new OdbcParameter("clinic_name ", clinic_name ));

You could refer to An ASP.NET Application Using a MySQL Database for more sample code.
Hope this helps.
 
Sincerely,
Young Fang
0
yyy8347
12/26/2006 6:42:12 AM
not sure how the above work because the wizard only ask for sql whether through query builder or hand code manually. anyway, thanks.
My HomePage - www.findingsteve.net

"It is more blessed to give than to receive." Acts 20: 35 (NIV, Bible)

Progress - "Never discourage anyone...who continually makes progress, no matter how slow." Plato
0
ngaisteve1
12/29/2006 1:33:51 AM

I think query should be :

"SELECT * FROM clinic WHERE state =\"@state\"";


.NET and Java planets
0
weknowtheworld
1/16/2007 7:07:53 AM
Reply:

Similar Artilces:

Converting SQL syntax to MySQL syntax
 Hi, the following is a stored procedure written for SQL,  would this work in MySQL or do I have to change the syntax? If so would you please point me to the site that will show me how to convert it to one that is equivalent to the MySQL syntax?  Thank you in advance for your help.CREATE PROCEDURE sp_PagedItems    (     @Page int,     @RecsPerPage int    )AS-- We don't want to return the # of rows inserted-- into our temporary table, so turn NOCOUNT ONSET NOCOUNT ON--Create a temporary tableCREATE TABLE ...

MySQL
Currently have a site coded in PHP but the customer wants to go to .NET. Can I use the existing MySQL DB or am I required to use MSSQL? Thanks, Ken Check out this forum which is specialized for this kind of questions: ASP.NET MySQL forumBart De Smet [MVP] Visit www.msdn.be, www.bartdesmet.net...

mysql syntax problem
Hi all when i query a mysql db within a perl script this works fine... $sth = $dbh->prepare ("SELECT venue from base1 WHERE op = 'K Trevan'"); this doesn't.. $sth = $dbh->prepare ("SELECT venue from base1 WHERE op = 'K O'Trevan'"); i know the issue is 'K O'Trevan' in that the 2nd ' completes i just don't know how to resolve it - other than changing 'K O'Trevan' to 'K O Trevan' Any ideas appreciated Steve On Wed, Oct 02, 2002 at 09:06:16AM +0100, Steven_Massey...

SQL Syntax in DBD::mysql
------=_NextPart_000_000D_01C263B6.FA136D10 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I am trying to use the following code to insert data into a mysql = database:- # write the information to the database $sth=3D$dbh->prepare("INSERT INTO = images(name,desc,category,subcat1,subcat2,image) VALUES(?,?,?,?,?,?)"); $sth->bind_param(1,$name); $sth->bind_param(2,$desc); $sth->bind_param(3,$category); $sth->bind_param(4,$subcat1); $sth->bind_param(5,$subcat2); $sth->bind_param(6,$photo); ...

mysql php5-mysql
Hi, i have installed mysqk from binaries itworks!!! but now how can i install php5-mysql and dependencies? Many thanks Thierry -- trazomtg ------------------------------------------------------------------------ When you say from the binaries, do you mean you installed via Yast and the Suse repositories?? It is always best to install via Yast-Software-Software Management if you can. This way all dependencies are done for you. -- gogalthorp ------------------------------------------------------------------------ gogalthorp's Profile: http://forums.opensuse....

Err: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax
I get this error message in cmd.ExecuteNonQuery() "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '//' at line 1" when I run the code below. The concept is to read some values from a databse and write the result into another databse if the condition is satisfied. Dim conString As StringDim myconn As MySqlConnection Dim sql As String conString = "Server=localhost; Database=xyz; Uid=root"myconn = New MySqlConnection(conString)   sql = "Select site_id, timestring...

mysql problem when running checksetup, mysql server has gone away
Hi! I'm installing latest bugzilla on Windows 2000 Server with SP2 according to these instructions: http://www.bugzilla.org/docs/win32install.html Well not 100% according to those instructions as they are not up to date with latest Perl, but pretty close. I'm using a fresh install of the latest MySQL 5, Perl and Apache 2.2. I'm at the step where I run checksetup.pl. All goes well, a bunch of tables are created, but then: ------------------------------- cut here ------------------------- Adding new table milestones ... DBD::mysql::st execute failed: MySQL serv...

Problems w/ DBD::mysql Perl module after upgrading MySql
I just spent an unpleasant Friday evening getting Bugzilla (v3.2) running again after I upgraded MySQL to 5.0.51a on my Debian server. After the upgrade (part of upgrading Debian, which also upgraded Perl to v5.10), checksetup.pl would abort with an error, complaining about an "undefined symbol in lib/i486-linux-gnu-thread-multi/auto/DBD/mysql.so: Perl_Tstack_sp_ptr." To make a long story short, I ended up deleting (renaming, actually) the whole 'lib/i486-linux-gnu-thread-multi' directory in the 'bugzilla' directory, and running install-modules.pl --all ...

MySql ado.net connector problem
My host doesn't offer SqlServer, so I'm taking a swing at MySql and so far I'm getting a FileNotFoundException in my asp.net app when I try to instantiate a MySqlConnection object. I have added a reference to the dll and including the namespace in my using directive. Here is the stack trace: [FileNotFoundException: The system cannot find the file specified.] [FileNotFoundException: File or assembly name 'MySql.Data, Version=1.0.4.20163, Culture=neutral, PublicKeyToken=c5687fc88969c44d', or one of its dependencies, was not found.]    TheHudsonDrags.Back...

MySql .NET Connector Parameter Problem
I am trying to insert data into a MySql Database on the local machine. I first recieved the error of "Column 'content_type' cannot be null." I changed the parameter in the SQL from "@content_type" to "?". Now I am getting the error message of "Parameter '?' is not defined." I am adding the parameter to the parameters collection of the MySqlCommand, but apparently it isn't getting added. Here is a portion of the code:strSql="insert into images(content_type) values(?);";sqlCmd=new MySqlCommand(strSql,sqlCnn);sqlCmd.Parameters.Add(new MySqlParameter("@content_type","jpeg"));I searched the forum...

SQL Syntaxual problem Native Mysql user
hello guys i am  trying to execte a more advanced SQL statment then i have been previusly doing but it dosent seem to understand it, am i lacking in knowledge about somthing ?it dosent understand the LIMIT or do anything about the ran() sqlCmd.CommandText = "" +"SELECT question " +"FROM questions " +"WHERE test_id='" + Request.QueryString["id"] + "' "+"ORDER BY RAND() " +"LIMIT 1 " +";";  it dosent understand the LIMIT or do anything about the ran() Hi,Limit is same a Top and...

store procedure to mysql sql command problems
Can anyone show me how to change this store procedure to SQL command. Before that i use MSSQL server, i create store procedure to get certain employee's record. " Create procedure admin ( @Username nvarchar(50), @name nvarchar(50) Output, @title nvarchar(50) output ) as Select @name = adminname, @title = admintitle From Admin Where AdminID = @Username " so now if i want to get two output by using satu transact - sql command only, can make it? I mean if i use MySQL ver4.1 window. Thanks Thank you very much.best regards,floren...

MySql Problem with the VS.NET Server Explorer
I am new to mySql and VS.NET so please forgive this question if it seems a little lame. I installed version 4.1 of mySQL on my 64 bit Windows machine.  I then installed the .NET Connector MySql.Data.MySqlClient.  At this point I wanted to test the connector classes.  So I wrote a small C# program to connect to a local database, read a record from the database, close the data reader and the connection.  This was all done using the following classes:      MySqlConnection       MySqlCommand   &nb...

Converting from PHP/MySQL to .NET/SQL Server
Hello W are looking to convert several applications to .NET using SQL Server. I see where the migration assistant can be of great help with most of the code. I was wondering what would be the best approach to covert the SQL database syntax from MYSQL to SQL Server Thanks in advance for your help! Dave It depends on how you would like to do it. There are a few ways to go about it: A) Convert all applicable SQL to stored procedures. B) Convert most, but not all (some might be difficult) to stored procedures and leave the rest as they are. C) Leave them all. If you p...

Web resources about - My sql syntax for MySQL got problem? - asp.net.mysql

Is–ought problem - Wikipedia, the free encyclopedia
The is–ought problem in meta-ethics as articulated by Scottish philosopher and historian David Hume (1711–76) is that many writers make claims ...

More to Slater & Gordon's problems than just the UK
As Slater & Gordon comes under increasing pressure, questions are being asked when the company's problems actually began.

This one app could solve your most frustrating home Wi-Fi problems
So you've just set up your home Wi-Fi network but for some reason you're having trouble getting your PC to connect to the network. It could very ...

This 1-minute visualization on space junk reveals a serious problem
... will completely obliterate a satellite and turn it into hundreds of smaller pieces. As you can imagine, this only exacerbates the problem because, ...

Oakland Airport On Alert; Southwest Flight Encounters Problem
CBS Local Oakland Airport On Alert; Southwest Flight Encounters Problem CBS Local FORT LAUDERDALE, FL - SEPTEMBER 27: A Southwest airplane ...

Southwest flight reports gear problem, burns fuel before landing attempt
Crews at Oakland International Airport are standing by on "yellow alert" for return of Chicago-bound flight

Far from smelling like a Rose, Bulls' problems go deeper than chemistry
There is a lot of chemistry talk circulating about the suddenly floundering Bulls, but Chicago's problems go much deeper than that.

Engine problem sends Virginia-bound plane back to New York
... shortly after takeoff. A spokesman for the FAA says the crew of Commutair Flight 3585 declared an emergency because of an "engine-related problem" ...

IT pros brace for lost devices, access problems, on-call holidays
More than half (56%) of IT pros will be on-call or working during the holidays to troubleshoot tech problems, according to network management ...

Jeb Steps In It: 'The Problem With The Confederate Flag Isn't The Confederacy'
... he's explaining the Confederate flag. To Jeb, we shouldn't be so offended by the Confederacy, but just what it meant later. TPM : "The problem ...

Resources last updated: 12/27/2015 4:12:29 PM