Subject select from stored procedure in c#
Author marcelo.miorelli@kiddeuk.co.uk
Hi all,

I am trying to select from a stored procedure using firebird 1.5 with
Firebird .NET data provider 1.6 and I just have not been able to.
The stored procedure receives the user name and the application name and
returns all menu options for that user according to his role.

if I just change mySelectQuery to mySelectQuery = "select * from lang";
Then I can read the myReader.

Could someone explain how to do this in a proper way?
Thanks in advance.

Marcelo Miorelli




private void frmMenu00_Load(object sender, System.EventArgs e)
{

try
{

string mySelectQuery = "select menuoption from
menuoptions('" + UserName + "','" + Application.ProductName + "')";





FbConnection myConnection = new FbConnection
(ConnectionString);
myConnection.Open();

FbTransaction myTxn =
myConnection.BeginTransaction();
FbCommand myCommand = new
FbCommand(mySelectQuery, myConnection, myTxn);

FbDataReader myReader;
myReader = myCommand.ExecuteReader();

int i = 0;
Array s = Array.CreateInstance(typeof(String),999);

if ( myReader.HasRows)
while ( myReader.Read() ) {

s.SetValue(myReader.GetString(0),i++);


}; //while

myReader.Close();
myConnection.Close();


//SeeMenu(null,s);

}//try
catch (Exception Krishna_Exception)
{

MessageBox.Show(Krishna_Exception.Message,
"Exception in frmMenu00_Load -
Sorting out the menu.",
MessageBoxButtons.OK);
this.Close();

}//catch


________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________