Click here to Skip to main content
15,903,030 members
Home / Discussions / Database
   

Database

 
QuestionSQL Server 2000 mirror Database Pin
AcDev727-Jun-07 1:01
AcDev727-Jun-07 1:01 
AnswerRe: SQL Server 2000 mirror Database Pin
Mike Dimmick27-Jun-07 2:24
Mike Dimmick27-Jun-07 2:24 
GeneralRe: SQL Server 2000 mirror Database Pin
Colin Angus Mackay27-Jun-07 12:19
Colin Angus Mackay27-Jun-07 12:19 
GeneralRe: SQL Server 2000 mirror Database Pin
Mike Dimmick27-Jun-07 23:30
Mike Dimmick27-Jun-07 23:30 
QuestionStored procedure Pin
sidbaruah26-Jun-07 23:36
sidbaruah26-Jun-07 23:36 
AnswerRe: Stored procedure Pin
mamatha_raghu27-Jun-07 0:17
mamatha_raghu27-Jun-07 0:17 
AnswerRe: Stored procedure Pin
Pratik Vasant Shah27-Jun-07 19:44
Pratik Vasant Shah27-Jun-07 19:44 
Questionmysql input with stored procedure help Pin
boyindie26-Jun-07 23:20
boyindie26-Jun-07 23:20 
Hi Forum,

I am having some really iritating problems with an simple input page which should pass parameters into a stored procedure from the text boxes first and last name.

I keep getting the error during exection of sp_myinsert, pfirstname not defined, every time i try to submit the form

Has anyone got any suggestions I have giving my code for procedure and page

many thanks
boy
--------------------------------

CREATE DEFINER=``@`localhost` PROCEDURE `sp_myInsert`(pFirstName varchar(20), pLastName varchar(30))
BEGIN
INSERT INTO Names (FirstName, LastName) values (pFirstName, pLastName);

END
-------------------------------------------

<%@ Page Language="VB" debug="true" %>
<%@ Import Namespace = "System.Data" %>
<%@ Import Namespace = "MySql.Data.MySqlClient" %>
<script language="VB" runat="server">

Sub page_load()

End Sub

''' <summary>
''' Page_load
''' Recognised by ASP and must be provided on loading of page.
'''
''' Creates connection to database, passes stored procedure into test database
''' and fills a table, which is showing in web browser
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
''' <remarks></remarks>


Sub sendData(ByVal sender As Object, ByVal e As EventArgs)
Dim litErr As New LiteralControl


'Create connection string to pass database, string holds login information to mySQL,
Dim connectionString As String
connectionString = "Server=; uid=; pwd=;database=test;"

'Builds .net mysql connection and passes connection string into method
Dim connection As New MySqlConnection(connectionString)
'Open connection to DB
connection.Open()

'Create mySql command string for passing query or SPROC(Stored Procedure)
Dim cmdString As New MySqlCommand
'Set Command to equal mySql connection,t so can pass SQL query
cmdString.Connection = connection

Try
'Set command string to equal SPROC
cmdString.CommandText = "sp_myinsert"
'ONLY PLACE THIS IF SPROC, sets the command to a SPROC
cmdString.CommandType = CommandType.StoredProcedure

Dim param As New MySqlParameter


param = cmdString.Parameters.Add("p_firstname", MySqlDbType.VarChar)
param.Direction = ParameterDirection.Input
param.Value = txtFirstName.Text

param = cmdString.Parameters.Add("p_lastname", MySqlDbType.VarChar)
param.Direction = ParameterDirection.Input
param.Value = txtLastName.Text


cmdString.ExecuteNonQuery()
connection.Close()
Catch ex As Exception
litErr.Text = ex.Message
MsgBox(ex.Message)

End Try



End Sub



</script>

<!DOCTYPE html PUBLIC
<head id="Head1" runat="server">
<title>Untitled Page</title>
<script language="vbscript" type="text/vbscript">

</script>
</head>
<body>
<form id="form1" runat="server">

ENTER FIRSTNAME<asp:TextBox runat="server" ID="txtFirstName">
</asp:TextBox><br /><br />
ENTER LAST NAME&nbsp;
<asp:TextBox runat="server" ID="txtLastName"></asp:TextBox>&nbsp;
<asp:Button runat="server" ID="submit" Text="Submit" onclick="sendData" />



</form>
</body>
</html>

AnswerRe: mysql input with stored procedure help Pin
Devkranth Kishore Vanja28-Jun-07 20:42
Devkranth Kishore Vanja28-Jun-07 20:42 
GeneralRe: mysql input with stored procedure help Pin
boyindie28-Jun-07 21:48
boyindie28-Jun-07 21:48 
Questionsharing sql server without client installation Pin
mamatha_raghu26-Jun-07 20:41
mamatha_raghu26-Jun-07 20:41 
AnswerRe: sharing sql server without client installation Pin
Manas Bhardwaj26-Jun-07 22:24
professionalManas Bhardwaj26-Jun-07 22:24 
AnswerRe: sharing sql server without client installation Pin
originSH26-Jun-07 22:29
originSH26-Jun-07 22:29 
GeneralRe: sharing sql server without client installation Pin
mamatha_raghu27-Jun-07 0:06
mamatha_raghu27-Jun-07 0:06 
GeneralRe: sharing sql server without client installation Pin
originSH27-Jun-07 1:06
originSH27-Jun-07 1:06 
AnswerRe: sharing sql server without client installation Pin
Mike Dimmick27-Jun-07 2:46
Mike Dimmick27-Jun-07 2:46 
QuestionSequence of events/methods execuion in SSIS Pin
I.explore.code26-Jun-07 19:57
I.explore.code26-Jun-07 19:57 
Questionpull subscriptions Pin
SVb.net26-Jun-07 12:58
SVb.net26-Jun-07 12:58 
QuestionDatabase design for exam system? Pin
HinJinShah26-Jun-07 8:08
HinJinShah26-Jun-07 8:08 
AnswerRe: Database design for exam system? Pin
Ashiq Shaikh26-Jun-07 22:56
professionalAshiq Shaikh26-Jun-07 22:56 
GeneralRe: Database design for exam system? Pin
HinJinShah27-Jun-07 6:31
HinJinShah27-Jun-07 6:31 
QuestionProblem configuring an OldDbDataAdaptor in VS03 Pin
Dan Neely26-Jun-07 4:54
Dan Neely26-Jun-07 4:54 
AnswerRe: Problem configuring an OldDbDataAdaptor in VS03 Pin
Dan Neely26-Jun-07 6:58
Dan Neely26-Jun-07 6:58 
AnswerRe: Problem configuring an OldDbDataAdaptor in VS03 Pin
hisi_200526-Jun-07 16:50
hisi_200526-Jun-07 16:50 
QuestionCalling all Irish devs!! Region-specific characters Pin
Mel Padden26-Jun-07 4:48
Mel Padden26-Jun-07 4:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.