Click here to Skip to main content
15,898,222 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionLarge Stored Proceedure Pin
oskardiazdeleon26-Jun-07 5:57
oskardiazdeleon26-Jun-07 5:57 
AnswerRe: Large Stored Proceedure Pin
Christian Graus26-Jun-07 11:12
protectorChristian Graus26-Jun-07 11:12 
QuestionHow can I get an attribute of a DropDownList item using javascript? Pin
Martin_26-Jun-07 5:40
Martin_26-Jun-07 5:40 
AnswerRe: How can I get an attribute of a DropDownList item using javascript? Pin
kubben26-Jun-07 7:49
kubben26-Jun-07 7:49 
GeneralRe: How can I get an attribute of a DropDownList item using javascript? Pin
Martin_26-Jun-07 7:54
Martin_26-Jun-07 7:54 
GeneralRe: How can I get an attribute of a DropDownList item using javascript? Pin
Martin_27-Jun-07 3:24
Martin_27-Jun-07 3:24 
GeneralRe: How can I get an attribute of a DropDownList item using javascript? Pin
kubben27-Jun-07 3:27
kubben27-Jun-07 3:27 
QuestionSending Data Pin
boyindie26-Jun-07 5:03
boyindie26-Jun-07 5:03 
Hi
I have built a simple page which will should send a persons firstname and lastname to mysql database, i am not sure how to code the submit button as i obviously need it to call my method for sending data to the server based on the input in my text boxes.

Any suggestions, i recognise is probably fundamental but am newbie to asp and not got much web development background

This is what I have

<%@ 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)
'Create connection string to pass database, string holds login information to mySQL,
Dim connectionString As String
connectionString = "Server=; uid=; pwd=;database=;"

'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
'Set command string to equal SPROC
cmdString.CommandText = "insertmessage"
'ONLY PLACE THIS IF SPROC, sets the command to a SPROC
cmdString.CommandType = CommandType.StoredProcedure

Dim param As New MySqlParameter


param = cmdString.Parameters.Add("param1", SqlDbType.VarChar, 50)
param.Direction = ParameterDirection.Input
param.Value = txtFirstName.Text

param = cmdString.Parameters.Add("param2", SqlDbType.VarChar, 50)
param.Direction = ParameterDirection.Input
param.Value = txtLastName.Text


cmdString.ExecuteNonQuery()


End Sub



</script>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<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" />



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

AnswerRe: Sending Data Pin
Not Active26-Jun-07 5:09
mentorNot Active26-Jun-07 5:09 
AnswerRe: Sending Data Pin
Fred_Smith26-Jun-07 5:18
Fred_Smith26-Jun-07 5:18 
GeneralRe: Sending Data Pin
boyindie26-Jun-07 6:01
boyindie26-Jun-07 6:01 
GeneralRe: Sending Data Pin
Fred_Smith26-Jun-07 6:09
Fred_Smith26-Jun-07 6:09 
GeneralRe: Sending Data Pin
boyindie26-Jun-07 6:28
boyindie26-Jun-07 6:28 
GeneralRe: Sending Data Pin
Fred_Smith26-Jun-07 6:53
Fred_Smith26-Jun-07 6:53 
QuestionExport & Import Pin
Sinchan Nikam26-Jun-07 4:01
Sinchan Nikam26-Jun-07 4:01 
AnswerRe: Export & Import Pin
Not Active26-Jun-07 5:05
mentorNot Active26-Jun-07 5:05 
Questionauto response of mails. Pin
hkchauhan26-Jun-07 3:40
hkchauhan26-Jun-07 3:40 
AnswerRe: auto response of mails. Pin
Not Active26-Jun-07 5:01
mentorNot Active26-Jun-07 5:01 
AnswerRe: auto response of mails. Pin
Venkatesh Mookkan26-Jun-07 18:16
Venkatesh Mookkan26-Jun-07 18:16 
Questionform EncType=&quot;Multipart/Form-Data&quot; Pin
Brendan Vogt26-Jun-07 3:31
Brendan Vogt26-Jun-07 3:31 
AnswerRe: form EncType=&quot;Multipart/Form-Data&quot; Pin
Viral Upadhyay26-Jun-07 3:45
Viral Upadhyay26-Jun-07 3:45 
QuestionSQL Query in Multi-line TextBox in Web form Pin
Blumen26-Jun-07 3:28
Blumen26-Jun-07 3:28 
AnswerRe: SQL Query in Multi-line TextBox in Web form Pin
Viral Upadhyay26-Jun-07 3:41
Viral Upadhyay26-Jun-07 3:41 
GeneralRe: SQL Query in Multi-line TextBox in Web form Pin
Blumen26-Jun-07 19:11
Blumen26-Jun-07 19:11 
GeneralRe: SQL Query in Multi-line TextBox in Web form Pin
Viral Upadhyay26-Jun-07 20:30
Viral Upadhyay26-Jun-07 20:30 

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.