.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to get output parameter asp.net 3.5 database is mysql 5.1

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :ASP.Net


I am using mysql 5.1. odbc driver 5.1.

I have created a stored proc and declared a parameter as output. In asp.net I am getting an error.

ERROR [HY000] [MySQL][ODBC 5.1 Driver][mysqld-5.5.11]OUT or INOUT argument 7 for routine facebookdb.SP_FB_Add_Registration is not a variable or NEW pseudo-variable in BEFORE trigger

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.Odbc.OdbcException: ERROR [HY000] [MySQL][ODBC 5.1 Driver][mysqld-5.5.11]OUT or INOUT argument 7 for routine facebookdb.SP_FB_Add_Registration is not a variable or NEW pseudo-variable in BEFORE trigger

please help me out how to get the value of output parameter

View Complete Post

More Related Resource Links

Enterprize library 4.1 getting output parameter after adding record in db, plz guide



I need to get output parameter (flag) from db after saving record in database. I am using Microsoft Enterprise Library 4.1 for DB. I am inserting record using I Data reader.

Please guide


search in mysql database, mvc



I have set up a mysql connection in visual studio 2010 and now i have a connection and dont really know where to go next.

I want to be able to search the data and get the result in a view.

using asp.net mvc

Saving textbox data to MySql database in asp.net


Hi dear coders

though a very simple question to ask, but please tell me how to save and retrieve data in/from my textboxes to/from database (MYSQL) on submit button click.

i know its a very simple task but i cant make it done, so i request you to please send me some working example link or post any helpful code here in asp.net

i will be highly thankful for any kind help from you geniuses.



get the last inserted row ( autoincrement id ) in mysql database back


In my mysql I have an autoincrement id , whenever I add a new row into database I need to store this id in other table, so how to get this autoincrement Id back?

output cache to be used only when parameter has changed + old question of user control not answered



i have 2 questions about output cache:

1.is it just me , or does it seems that it is used only after the second time that the user reaches the webpage? if so, why, and how can i tweak it to my needs? my guess is that it wouldn't be logical to cache every time a user reach a webpage, but only when it happens enough times.

2.i know that i can use "varybyparam" for using the output cache when the parameter doesn't change , but it seems that it would use the output cache even if there is no parameter , or if the specified paramter is not there. is there a way to overcome this?

3.an old question that somehow marked as "answered" , yet i didn't solve : suppose i created a user control and i gave it values through the CTOR via the aspx file . is it possible to show the values from within the split/design mode? remember that i've talking about ASP.NET and not simply C# winforms . i write this because this question was on :


and the answer that i got was for C# and winforms . i've tried to do the same for ASP.NET , but i've failed.

can anyone please help me?

optional output parameter in CLR Stored Procedure

I'm trying to transpose a Procedure that sends mail via CDO.Message and Ole Automation to a .Net CLR Procedure. this procedure must have the same parameters in the same order as the original to maintain compatibility with everything that already uses it. the declaration goes as follow   <Microsoft.SqlServer.Server.SqlProcedure(name:="SP_ENVIAEMAIL")> _<br/> Public Shared Sub ENVIAEMAIL(<SqlFacet(MaxSize:=100)> Optional ByVal De As String = "", <SqlFacet(MaxSize:=100)> Optional ByVal Para As String = "", _<br/> <SqlFacet(MaxSize:=100)> Optional ByVal Copia As String = "", <SqlFacet(MaxSize:=100)> Optional ByVal Oculta As String = "", _<br/> <SqlFacet(MaxSize:=100)> Optional ByVal Assunto As String = "", <SqlFacet(MaxSize:=-1)> Optional ByVal Mensagem As String = "", _<br/> <SqlFacet(MaxSize:=-1)> Optional ByVal Anexo As String = "", _<br/> <strong><SqlFacet(MaxSize:=1000)> <Out()> Optional ByVal Retorno As String = ""</strong> , _<br/> <SqlFacet(MaxSize:=100)> Optional ByVal Smtp As String = "", <SqlFacet(MaxSize:=100)> Optional ByVal Usuario As String = "",

output parameter sp/c#

 Hi I have a problem getting my code right. I got "String[1]: the Size property has an invalid size of 0." in my c# code. SP:SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE sp_GetUserName ( @UserNames UserNamesType READONLY, @tmpUserNames nvarchar(max) OUTPUT) AS BEGIN SET NOCOUNT ON; DECLARE @tmpUser nvarchar(max); SELECT @tmpUser = (FirstName + ' ' + LastName + ',') FROM Users WHERE [Login] = (SELECT UserName FROM @UserNames) SET @tmpUserNames = @tmpUser RETURN END GO   public static string GetUserName(DataTable dtUser) { string err = String.Empty; string userResult; string sqlText = "sp_GetUserName"; try { using (SqlCommand cmd = new SqlCommand(sqlText, connect.GetSqlConnection(out err))) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@UserNames", SqlDbType.Structured).Value = dtUser; cmd.Parameters.Add("@tmpUserNames", SqlDbType.Text).Direction = ParameterDirection.Output; cmd.ExecuteNonQuery(); userResult = (string)cmd.Parameters["@tmpUserNames"].Value; return userResult; } } catch (SqlException ex) { return null; } } Can someon

Database deletion not working when parameter involved

Hi,I have a system in which users can enter records into a database via ajax.  Each user may hold many values in the database, with different pageId and itemId values.  Each user is identified by a GUID set to a cookie.  The system needs to prevent the user from entering two pieces of data with the same pageId and itemId, so I've created a script to do two database updates:Firstly, all records are deleted from the database where the memberGUID, pageId and itemId fields match (i.e. they've already added this item).Secondly, the record is then recreated.It all works brilliantly, except when the GUID value is passed into the delete statement, then I just get a caught exception.So this works: public class UpdateValue { public static string Hello(int pageId, int itemId, string inOut, string period, decimal value) { //Initialise variables and objects string cookie = HttpContext.Current.Request.Cookies["visitorGUID"].Value; inOut = inOut.Substring(0, 1); //Delete value if already present SqlConnection connDel; connDel = new SqlConnection(GlobalSettings.DbDSN); SqlCommand commDel; commDel = new SqlCommand("DELETE FROM budgetData WHERE pageId = @pageId AND itemId = @itemId;", connDel); commDel.Parameters.Add("@pageId", System.Data.SqlDbType.Int); commDel.Parameters["@pageId"].Value = pag

passing parameter using ODBC - mysql

Dear All, I'm having problem on passing parameter on odbc because it's not working at all.  I tried this using sql and I have no problem at all. All are working fine.  Is there a different syntax on odbc?  Here's my code: Private Sub BindDetails() ' Obtain the index of the selected row Dim selectedRowIndex As Integer = GridEmployee.SelectedIndex ' Read the employee ID Dim IDNumber As Integer = GridEmployee.DataKeys(selectedRowIndex).Value ' Define data objects Dim conn As OdbcConnection Dim comm As OdbcCommand Dim reader As OdbcDataReader Dim connectionString As String = _ ConfigurationManager.ConnectionStrings( _ "mysqlconn").ConnectionString ' Initialize connection conn = New OdbcConnection(connectionString) ' Create command comm = New OdbcCommand("SELECT employee.IDNumber, employee.EmployeeID, project.ProjectName, team.TeamName, employee.Username, employee.`Password`, employee.LastName, employee.FirstName, employee.MiddleName, employee.NickName, employee.EmailAddress, employee.DateHired, employee.LengthService, employee.RegularizationDate, employeestatus.EmployeeStatusName, employee.Birthdate, employee.Mobile1, employee.Mobile2, employee.Phone1, employee.Address, employee.Colleg

SQL Server 2008 Stored Procedure output parameter

I would like to get OUTPUT parameter names from stored procedure without executing stored procedure.  for excample schema API will help to get input parameter metadata. Thanks in advance. Murali

Display records in bold coming from mysql database

hi,I have Mysql database.In that some records status is New.now,I bind database table to Listview(asp) control.What's my problem is,the New status records(from Mysql database) text in Listview(after binding) is visible in bold format.how to do this??Thanks in advance.

SQL Server Force Parameter at the database level?

If you do opt for force parameter at the database level, as I read SQL Server rebuilds plan cache but my questions is does that mean it rebuilds data cache also? Any things to watch out and your experiences dealing with force parameter at the db level..

SP Output parameter help

Hi,I hope someone can help me with sorting this out... I'm trying to build a stored procedure that returns multiple members' names when fed their memberIds.So far this is what I've got - it works fine with one exception - I'm not sure how to write the syntax so I can get the output parameter, @MemberNames? The code below outputs the names but without a column heading. I just want the names to be a string in the output parameter @MemberNamesCREATE PROCEDURE [dbo].[sp_NameResolution] --Add the parameters for the stored procedure here @ProfileId numeric, @MemberIds varchar(8000), -- this might be a string of ids numbers like 34,56,345 @MemberNames varchar(8000) Output, @SQL AS Varchar(8000) = NULL AS BEGIN SET NOCOUNT ON; SET @SQL = 'SELECT (RTRIM(Fname) + '' '' + RTRIM(Lname)) FROM MEMBERS WHERE (MemberIds IN (' + @MemberIds + ')) AND (ProfileID = '+ CAST(@ProfileId AS VarChar)+ ')' PRINT @SQL EXEC(@SQL) END I've tried different variations like..SELECT @MemberNames = (RTRIM(Fname) + '' '' + RTRIM(Lname)) ... etcbut because I'm executing it using EXEC(@SQL) it has a cow and won't output the parameter...Any ideas?Thanks a bunch,Jason

WPF client application connected to an ASP mySQL database

Dear all, I have a customer who is using an online ASP applciation which provide different type of application. My customer run this app within a browser or a simple local client app which s connected to a remote database accessible via an ADSL connection. Today my customer ask me to build a touch client application and collect those data based on different criteria. According to information I have today it seems that the database is mySQL ( not usre at 100%) In case it is mySQL, does any one has made a kind a gateway between mySQl and .net app when database is hosted remotely ? thnaks for advise if any regards SergeYour knowledge is enhanced by that of others.

Output table from database to excel spreadsheet asp.net c#

Hi All, I'm hoping someone can help me with a small problem. I want to output some data returned from a sql server database and output it out to an excel file. My thinking was to create some excel templates, copy the required one that I want to use and output the data to that. I can pull the data back from the database OK, but have no idea how to write this to the excel spreadsheet. I want to try and keep the code as generic as possible so that I can use it to output a resultset to the correct copied template. Any help or pointers would be greatly appreciated.

Code to get details from joomla MYSQL database in godaddy

I want to write a basic code to connect to joomla MY SQL database. I am getting issues with connection string. Can any one help me out with sample code if you did such work before. A simple code which retrives records and displayes in webform is what I require.   Thanks in advance Chandra 

Rounding problem for money output parameter from stored proc

I have a GridView sourced by a SQL Server stored procedure with several databound fields, including a money column for item values. My stored proc returns the data through a SELECT and everything looks good. The stored proc also has a single output parameter that sums the total value of the displayed data, and this value is displayed in a label above the GridView. The output parameter (defined as money on the SQL Server side) is passed back to the app in good shape, but is rounded when displayed in the DataSource_Selected event handler. So a total of $30,155.22 in SQL Server shows up as $30155 on my aspx.In debugging, I have confirmed that the value leaving SQL Server is correct (30155.2200), and I can see that the value coming IN to the ASP-side event handler is already rounded. What do I need to do here to coerce/force it to show as money/currency?Relevant snippets:Stored Proc:... @onHandValue money OUT...  CREATE TABLE #tempValueOnHand(... valueOnHand money )... set @onHandValue = (select round(sum(valueOnHand), 2) from #tempValueOnHand) set @onHandValue = (select sum(valueOnHand) from #tempValueOnHand)And again, the output parameter @onHandValue is coming back, just already rounded.On the ASP side:    Protected Sub SqlDataSource1_Selected(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceStatusEventArgs) Handles SqlDataSourc
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend