|
|||||||||||
|
RE: Proper way of retrieving an ?id via .net connection 5x on mysql
From: Peter de Bruine <p.debruine(at)giscare.nl>
Date: Wed Sep 19 2007 - 02:33:27 EDT
You should add the parameter to the command like this:
id=mirandajs;password=dba05pdx;");
comm = new MySqlCommand(String.Format("SELECT * from profile where id = ?id"), conn);
//Add parameter
MySqlDataReader reader = comm.ExecuteReader(); int otherId = reader.GetInt32("some-other-id"); But your example is very strange you are trying to get an id while you already have that id?? That's not really neccesary.
Regards
-----Oorspronkelijk bericht-----
I am having problems retrieving ?id, error is always parameter is not defined..
MySqlConnection conn = new
*Exception Details: *MySql.Data.MySqlClient.MySqlException: Parameter '?id' must be defined. *Source Error:*
Line 32:
Line 34: MySqlDataReader reader = comm.ExecuteReader();
Line 35:
Line 36: //int retrievedId = reader.GetInt32("id");
How can i properly add the parameter on this? Please help! -- Louie Miranda (lmiranda@gmail.com) http://www.axishift.com Security Is A Series Of Well-Defined Steps chmod -R 0 / ; and smile :) -- MySQL on .NET Mailing List For list archives: http://lists.mysql.com/dotnet To unsubscribe: http://lists.mysql.com/dotnet?unsub=lists@pantek.comReceived on Wed Sep 19 02:34:34 2007 This archive was generated by hypermail 2.1.8 : Sun Oct 07 2007 - 10:15:42 EDT |
||||||||||
|
|||||||||||