Re: How to load values into parameters
Posted by: David
Date: February 24, 2005 05:27PM

Assuming 'myField' in your database takes a varchar of length '50'...

string queryString = "SELECT * FROM myTable WHERE (myField = ?myParam);";

MySql.Data.MySqlClient.MySqlCommand command;

command	= new MySqlCommand(queryString, connection);

command.Parameters.Add("?myParam", MySqlDbType.VarChar, 50);

command.Parameters["?myParam"].Value = myTextBox.Text;

This is in C#. Don't have the VB code handy, but it's quite similar.

David

Options: ReplyQuote


Subject
Written By
Posted
Re: How to load values into parameters
February 24, 2005 05:27PM
February 25, 2005 09:21AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.