Click here to Skip to main content
15,892,674 members
Home / Discussions / C#
   

C#

 
GeneralRe: Plugin Architecture Pin
Nick Parker10-Sep-04 11:24
protectorNick Parker10-Sep-04 11:24 
GeneralRegex weakling help Pin
afronaut10-Sep-04 10:49
afronaut10-Sep-04 10:49 
GeneralRe: Regex weakling help Pin
Nick Parker10-Sep-04 11:20
protectorNick Parker10-Sep-04 11:20 
GeneralRe: Regex weakling help Pin
Heath Stewart10-Sep-04 11:48
protectorHeath Stewart10-Sep-04 11:48 
GeneralRe: Regex weakling help Pin
Heath Stewart10-Sep-04 12:25
protectorHeath Stewart10-Sep-04 12:25 
Generalenabling/disabling internet access Pin
Asim N.10-Sep-04 9:32
Asim N.10-Sep-04 9:32 
GeneralRe: enabling/disabling internet access Pin
Dave Kreskowiak10-Sep-04 10:11
mveDave Kreskowiak10-Sep-04 10:11 
Generalhelp in c# web service Pin
jacal9910-Sep-04 8:24
jacal9910-Sep-04 8:24 
hi
i am trying to make a simple web application using web services with c# web matrix
i have get the data from html page and i can print it on my aspx page
but i could not be able to pass my data to my web services
in my web services i want to send my data in access database
we i show you my code as under that i used ...


this is my html code

<html>
<head>
</head>
<body>
<form id="Form1" name="form1" action="aspx1.aspx" method="post">
<p>
</p>
<p>
First Name:<input type="text" name="fname"/>
</p>
<p>
Last Name:<input type="text" name="lname"/>
</p>
<p>
<input type="submit" value="Submit" />
</p>
</form>
</body>
</html>


this is my aspx page code

<%@ Page Language="C#" Debug=true %>

<script runat="server">

void Page_Load(object src,EventArgs e)
{
String fn,ln;

fn = Request.Form.Get("fname");
ln=Request.Form.Get("lname");


Response.Write("Your First Name is = " +"<b>" +fn +"</b>" +"<br>");

Response.Write("Your Last Name is = " +"<b>" +ln +"</b>" +"<br>");


}

</script>
<html>
<head>
</head>
<body>
</body>
</html>


and this is my web services code

<%@ WebService language="C#" Debug="True" class="my" %>

using System;
using System.Web.Services;
using System.Xml.Serialization;

public class my {

[WebMethod]
public void Add(string a, string b) {
OleDbConnection objConnection = null;
OleDbCommand objCmd = null;
string strConnection, strSQL;
strConnection = "Provider=Microsoft.Jet.OLEDB.4.0 ;Data Source="+Server.MapPath(".\\database\\t1.mdb");
// Create and open the connection object
objConnection = new OleDbConnection(strConnection);
objConnection.Open();

// Set the SQL string
strSQL = "INSERT INTO sis (fname, lname) VALUES ( a , b)";

// Create the Command and set its properties
objCmd = new OleDbCommand(strSQL, objConnection);

// here our ionsert query will execute and insertour data in the database.
objCmd.ExecuteNonQuery();
objConnection.Close();
}
}


Mazhar Hussain
GeneralRe: help in c# web service Pin
Heath Stewart10-Sep-04 11:49
protectorHeath Stewart10-Sep-04 11:49 
GeneralBrowsing Network Places... Pin
ajvn10-Sep-04 8:11
sussajvn10-Sep-04 8:11 
GeneralRe: Browsing Network Places... Pin
Nick Parker10-Sep-04 8:44
protectorNick Parker10-Sep-04 8:44 
GeneralRe: Browsing Network Places... Pin
Dave Kreskowiak10-Sep-04 10:14
mveDave Kreskowiak10-Sep-04 10:14 
GeneralHelp with assembly load Pin
GeloSoft10-Sep-04 6:07
GeloSoft10-Sep-04 6:07 
GeneralRe: Help with assembly load Pin
Heath Stewart10-Sep-04 6:16
protectorHeath Stewart10-Sep-04 6:16 
GeneralRe: Help with assembly load Pin
GeloSoft10-Sep-04 7:10
GeloSoft10-Sep-04 7:10 
GeneralRe: Help with assembly load Pin
Heath Stewart10-Sep-04 7:15
protectorHeath Stewart10-Sep-04 7:15 
GeneralRe: Help with assembly load Pin
GeloSoft11-Sep-04 14:35
GeloSoft11-Sep-04 14:35 
GeneralRe: Help with assembly load Pin
Heath Stewart11-Sep-04 16:03
protectorHeath Stewart11-Sep-04 16:03 
GeneralRe: Help with assembly load Pin
GeloSoft11-Sep-04 16:44
GeloSoft11-Sep-04 16:44 
GeneralRe: Help with assembly load Pin
Charlie Williams11-Sep-04 19:12
Charlie Williams11-Sep-04 19:12 
GeneralWinform DataGrid HELP HELP! Pin
Looney Tunezez10-Sep-04 5:53
Looney Tunezez10-Sep-04 5:53 
Questionlocal/global variables? Pin
Heks10-Sep-04 5:43
Heks10-Sep-04 5:43 
AnswerRe: local/global variables? Pin
Gary Thom10-Sep-04 6:10
Gary Thom10-Sep-04 6:10 
GeneralRe: local/global variables? Pin
Heks10-Sep-04 6:52
Heks10-Sep-04 6:52 
GeneralRe: local/global variables? Pin
Gary Thom10-Sep-04 13:16
Gary Thom10-Sep-04 13:16 

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.