Click here to Skip to main content
15,887,746 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Telerik Vs Devexpress Pin
Jasmine250128-May-13 7:30
Jasmine250128-May-13 7:30 
GeneralRe: Telerik Vs Devexpress Pin
Richard MacCutchan28-May-13 11:16
mveRichard MacCutchan28-May-13 11:16 
QuestionRe: Telerik Vs Devexpress Pin
ZurdoDev24-May-13 4:29
professionalZurdoDev24-May-13 4:29 
AnswerRe: Telerik Vs Devexpress Pin
Mohamed_hussain24-May-13 18:17
Mohamed_hussain24-May-13 18:17 
AnswerRe: Telerik Vs Devexpress Pin
ZurdoDev28-May-13 2:20
professionalZurdoDev28-May-13 2:20 
QuestionWeb Services / Web References in ASP.NET using C# Pin
WickedFooker23-May-13 0:50
WickedFooker23-May-13 0:50 
AnswerRe: Web Services / Web References in ASP.NET using C# Pin
Richard Deeming23-May-13 1:41
mveRichard Deeming23-May-13 1:41 
GeneralRe: Web Services / Web References in ASP.NET using C# Pin
WickedFooker23-May-13 11:27
WickedFooker23-May-13 11:27 
Richard thanks for the insight. I cleaned up things a bit to this:

clsWebServices.aspx.cs
C#
using System.Data.OleDb;
using System.Data;
using System.Web.Services;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;


[WebService(Namespace = "http://localhost:51557/Week3Lab/clsWebServices.asmx/FindAddress")]
public class clsWebServices : System.Web.Services.WebService {
    
    public clsWebServices () {

        //InitializeComponent();
        
    }
    
       [WebMethod(Description = "This method call will get the LastName and return the Dataset.", EnableSession = false)]  
        public dsAddress FindAddress(string LastName, string Path)
        {
            
            
            string connectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" + Path;
            string commandText = "select * from tblAddressBook where LastName like "+LastName ;


            dsAddress DS = new dsAddress();
            using (var connection = new OleDbConnection(connectionString))
            using (var command = new OleDbCommand(commandText, connection))
            {
               
                var adapter = new OleDbDataAdapter(command);
                adapter.Fill(DS.tblAddressBook);
            }

            // Add your comments here
            return DS;

        }
        
    
    
    
}


frmAddressBook.aspx.cs
C#
protected void btnFindLastName_Click(object sender, EventArgs e)
   {
       lblMessage.Text = "";
       lblMessage.Text = txtFindLastName.Text;
       try
       {
           clsWebServices serviceObj = new clsWebServices();
           dsAddress dsFindLastName = new dsAddress();
           string TempPath = Server.MapPath("~/App_Data/AddressBook.mdb");

           dsFindLastName = serviceObj.FindAddress(txtFindLastName.Text.ToString(), TempPath);

           if (dsFindLastName.tblAddressBook.Rows.Count > 0)
           {
               DataRow r = dsFindLastName.tblAddressBook.Rows[0];
               txtFirstName.Text = r["FirstName"].ToString();
               txtLastName.Text = r["LastName"].ToString();
               txtEmail.Text = r["Email"].ToString();
               txtPhoneNumber.Text = r["PhoneNumber"].ToString();
           }
           else lblMessage.Text = "No records found!";
       }
       catch (Exception ex)
       {
           lblMessage.Text = lblMessage.Text + ex.Message;
       }
   }


When I submit the FORM it has this in the submit :

C#
<form id="form1" runat="server" action="clsWebServices.asmx/FindAddress" method="post">


I am getting this though as an error:

System.InvalidOperationException: Missing parameter: LastName. at System.Web.Services.Protocols.ValueCollectionParameterReader.Read(NameValueCollection collection) at System.Web.Services.Protocols.HtmlFormParameterReader.Read(HttpRequest request) at System.Web.Services.Protocols.HttpServerProtocol.ReadParameters() at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()

GeneralRe: Web Services / Web References in ASP.NET using C# Pin
Richard Deeming24-May-13 1:42
mveRichard Deeming24-May-13 1:42 
GeneralRe: Web Services / Web References in ASP.NET using C# Pin
WickedFooker24-May-13 15:57
WickedFooker24-May-13 15:57 
Questionplease help me create form comment in asp.net mvc Pin
smile9x22-May-13 15:47
smile9x22-May-13 15:47 
AnswerRe: please help me create form comment in asp.net mvc Pin
dusty_dex22-May-13 21:06
dusty_dex22-May-13 21:06 
GeneralRe: please help me create form comment in asp.net mvc Pin
smile9x23-May-13 0:51
smile9x23-May-13 0:51 
QuestionStore string list Pin
byka21-May-13 7:53
byka21-May-13 7:53 
QuestionRe: Store string list Pin
ZurdoDev21-May-13 10:22
professionalZurdoDev21-May-13 10:22 
AnswerRe: Store string list Pin
Manfred Rudolf Bihy21-May-13 21:07
professionalManfred Rudolf Bihy21-May-13 21:07 
AnswerRe: Store string list Pin
poongunrans28-May-13 20:07
poongunrans28-May-13 20:07 
QuestionStart an async method inside an MVC action method. Pin
Brady Kelly21-May-13 6:43
Brady Kelly21-May-13 6:43 
Questionanyone plz tell me which is free version of iTextSharp library? Pin
manoj.jsm21-May-13 4:34
manoj.jsm21-May-13 4:34 
AnswerRe: anyone plz tell me which is free version of iTextSharp library? Pin
Thomas Daniels21-May-13 7:10
mentorThomas Daniels21-May-13 7:10 
QuestionMVC vs n-Tier Architecture Pin
Bikash Prakash Dash21-May-13 0:08
Bikash Prakash Dash21-May-13 0:08 
AnswerRe: MVC vs n-Tier Architecture Pin
Richard MacCutchan21-May-13 2:58
mveRichard MacCutchan21-May-13 2:58 
AnswerRe: MVC vs n-Tier Architecture Pin
Manfred Rudolf Bihy21-May-13 3:17
professionalManfred Rudolf Bihy21-May-13 3:17 
Questioninstallation of visual vsn server Pin
Member 870181320-May-13 21:25
Member 870181320-May-13 21:25 
QuestionValidation Question - Help Pin
WickedFooker20-May-13 14:25
WickedFooker20-May-13 14:25 

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.