From: Carlos G. A. <car...@te...> - 2003-07-24 17:51:16
|
Hello: > Here is the stored procedure. Could you just write me code of how YOU > would execute this stored procedure? It takes in a username and > userpassword, and it returns a userloginid and a userprivilegeid. Here is a sample of code that it's working for me, tell me if it's correct or not please :): FbConnection connection = new FbConnection(connectionString); connection.Open(); FbTransaction transaction = connection.BeginTransaction(); FbCommand command = new FbCommand("EXECUTE PROCEDURE LOGINUSER(@userloginname, @userloginpass)", connection, transaction); command.Parameters.Add("@userloginname", FbType.VarChar).Value = "A"; command.Parameters.Add("@userloginpass", FbType.VarChar).Value = "A"; command.Parameters.Add("@userloginid", FbType.Integer).Direction = ParameterDirection.Output; command.Parameters.Add("@userprivilegeid", FbType.SmallInt).Direction = ParameterDirection.Output; command.CommandType = CommandType.StoredProcedure; command.ExecuteNonQuery(); Console.WriteLine("Stored proc result: {0} {1}", command.Parameters["@userloginid"].Value, command.Parameters["@userprivilegeid"].Value); transaction.Rollback(); connection.Close(); -- Best regards Carlos Guzmán Álvarez Vigo-Spain |