Click here to Skip to main content
15,915,163 members
Home / Discussions / C#
   

C#

 
GeneralRe: Winform DataGridView Pin
jason_mf15-Apr-11 7:14
jason_mf15-Apr-11 7:14 
GeneralRe: Winform DataGridView Pin
GenJerDan15-Apr-11 15:24
GenJerDan15-Apr-11 15:24 
QuestionAjax File upload using a handler file Pin
dbongs15-Apr-11 3:53
dbongs15-Apr-11 3:53 
AnswerRe: Ajax File upload using a handler file Pin
BobJanova15-Apr-11 4:24
BobJanova15-Apr-11 4:24 
GeneralRe: Ajax File upload using a handler file Pin
dbongs17-Apr-11 22:46
dbongs17-Apr-11 22:46 
AnswerRe: Ajax File upload using a handler file Pin
Prasanta_Prince16-Apr-11 7:31
Prasanta_Prince16-Apr-11 7:31 
GeneralRe: Ajax File upload using a handler file Pin
dbongs17-Apr-11 22:52
dbongs17-Apr-11 22:52 
QuestionWeb service in asp.net using c# Pin
akosidandan14-Apr-11 19:44
akosidandan14-Apr-11 19:44 
Hello experts,

I would like to ask again if how will I'm going to edit my web services because it seems that it's only working on my local machine.
I tried to upload my web service and the 2 database(ms access 2003 and sql server 2005 express) to a free asp.net hosting site but I got and error that I cant access the database. I detach my sql server 2005 express to my sqlSERVER Management studio before I upload it.

Below is my sample code to my asmx file.

 using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;

//sql client import

using System.Data.SqlClient;
using System.Data;

using System.Data.OleDb;

namespace WebService1
{
    /// <summary>
    /// Summary description for Service1
    /// </summary>
    //[WebService(Namespace = "http://tempuri.org/")]
    //[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    //[System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class Service1 : System.Web.Services.WebService
    {

        

        
        

        [WebMethod]
        public DataTable getData()
        {
            OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\MemberSites\\MemberSites_AspSpider_Info\\akosiDAN\\database\\Database1.mdb");
            DataSet ds = new DataSet();
            DataTable dt = new DataTable();
            ds.Tables.Add(dt);

            OleDbDataAdapter da = new OleDbDataAdapter ("Select * from phonebooktable",con);
            da.Fill (dt);

            return dt;
        }

        [WebMethod]
        public DataTable getData()
        {
            SqlConnection con = new SqlConnection("server= DANDAN-PC\\SQLEXPRESS;uid=MYID;pwd=MYPASSWORD;database=phonebookdatabase");
            DataSet ds = new DataSet();
            DataTable dt = new DataTable();
            ds.Tables.Add(dt);

            SqlDataAdapter da = new SqlDataAdapter("Select * from phonebooktable", con);

            da.Fill(dt);

            return dt;
        }
    }
}



Any help are kindly appreciated.

Thanks,
DAN
AnswerRe: Web service in asp.net using c# Pin
Łukasz Nowakowski14-Apr-11 21:08
Łukasz Nowakowski14-Apr-11 21:08 
GeneralRe: Web service in asp.net using c# Pin
akosidandan14-Apr-11 21:34
akosidandan14-Apr-11 21:34 
GeneralRe: Web service in asp.net using c# Pin
BobJanova15-Apr-11 2:27
BobJanova15-Apr-11 2:27 
GeneralRe: Web service in asp.net using c# Pin
akosidandan15-Apr-11 17:29
akosidandan15-Apr-11 17:29 
AnswerRe: Web service in asp.net using c# Pin
Dave Kreskowiak15-Apr-11 1:57
mveDave Kreskowiak15-Apr-11 1:57 
GeneralRe: Web service in asp.net using c# Pin
akosidandan15-Apr-11 2:05
akosidandan15-Apr-11 2:05 
GeneralRe: Web service in asp.net using c# Pin
akosidandan15-Apr-11 17:30
akosidandan15-Apr-11 17:30 
AnswerRe: Web service in asp.net using c# Pin
Prasanta_Prince15-Apr-11 8:13
Prasanta_Prince15-Apr-11 8:13 
GeneralRe: Web service in asp.net using c# Pin
akosidandan15-Apr-11 17:27
akosidandan15-Apr-11 17:27 
Questiondatabase path Pin
arkiboys14-Apr-11 7:27
arkiboys14-Apr-11 7:27 
AnswerRe: database path Pin
Not Active14-Apr-11 10:03
mentorNot Active14-Apr-11 10:03 
GeneralRe: database path Pin
arkiboys14-Apr-11 10:50
arkiboys14-Apr-11 10:50 
GeneralRe: database path Pin
Not Active14-Apr-11 11:40
mentorNot Active14-Apr-11 11:40 
GeneralRe: database path Pin
arkiboys14-Apr-11 20:26
arkiboys14-Apr-11 20:26 
GeneralRe: database path Pin
Pravin Patil, Mumbai15-Apr-11 0:45
Pravin Patil, Mumbai15-Apr-11 0:45 
GeneralRe: database path Pin
Dave Kreskowiak15-Apr-11 1:54
mveDave Kreskowiak15-Apr-11 1:54 
AnswerRe: database path Pin
Prasanta_Prince15-Apr-11 8:15
Prasanta_Prince15-Apr-11 8:15 

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.