Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8489609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:52:30+00:00 2026-06-10T21:52:30+00:00

I have a datatable in my web service it goes like this [WebMethod] [ScriptMethod]

  • 0

I have a datatable in my web service it goes like this

 [WebMethod]
        [ScriptMethod]
        public DataTable mydbCon()
            {
SqlConnection SqlCon = new SqlConnection(@"Data Source=myds;Initial Catalog=name;Persist Security Info=True;User ID=sa;Password=pwd");
                SqlCon.Open();
                SqlCommand SqlComm = new SqlCommand();
                SqlComm.Connection = SqlCon;
                SqlComm.CommandType = CommandType.Text;
                SqlComm.CommandText = "select password from tbl_login where username='aby';";
                DataTable EmployeeDt = new DataTable("tbl_login");
                SqlDataAdapter SqlDa = new SqlDataAdapter(SqlComm);
                SqlDa.Fill(EmployeeDt);
                return EmployeeDt;
            }

and I am having a Ajax call in my HTML page it goes like this and I am not getting a value it shows the error message

<script type="text/javascript">
       function GetAge() {
           jQuery.support.cors = true;
           $.ajax({
               type: "POST",
               contentType: "application/json; charset=utf-8",
               dataType: "json",
               jsonp: 'jsonp_callback',
               async: false,
               url: "http://localhost:50113/Service1.asmx/mydbCon",
               data: "{}",
               success: function (msg) {
                    $('#divToBeWorkedOn').html(msg.d);
                },
               error: function (e) {
                   $('#divToBeWorkedOn').html("unavailable");
               }
           });
       }
      </script> 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T21:52:31+00:00Added an answer on June 10, 2026 at 9:52 pm

    at last I found out the answer you need to add ‘.text’ after ‘msg’ the line $(‘#divToBeWorkedOn’).html(msg.text);

    <script type="text/javascript">
         function GetAge() {
             jQuery.support.cors = true;
             $.ajax({
                 type: "POST",
                 async: false,
                 url: 'http://localhost:50113/Service1.asmx/mydbCon?wsdl',
                 success: function (msg) {
                       $('#divToBeWorkedOn').html(msg.text); 
    
                 },
                 error: function (e) {
                     $('#divToBeWorkedOn').html("unavailable");
                 }
             });
         } 
      </script>   
    

    Thanks palmpalm,Yuriy and everyone else for your support

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this function: [System.Web.Services.WebMethod] public static string EditPage(string nodeID) { DataTable dt =
I have a data table in my ASP.NET web service project, this data table
I have written this code which accesses the Delete method on Web Service x,
I have a web service method which i'd like to return multiple rows from
I have a .NET web service returning the following JSON: {command:getqcardjson,valuesets:[{datatable:eaa65990-8f88-45e0-966b-610858ad4cb6,values:[{Id:eaa65990-8f88-45e0-966b-610858ad4cb6,InternalName:Alpha Profile,TableName:Alpha Profile,OnMainMenu:,DefaultDataSourceId:bb4d1622-2e48-40b6-bea7-6355d701445c,DefaultOrder:100,IsChained:,IncludeInGlobalSearch:False,IsModelObject:,IsSchemaObject:,IsSecured:False,IsFileNewMenu:False,IsUpdateShouldRippleCache:False,AdvancedSearchQueryId:,CompoundViewQueryId:,GlobalSearchQueryId:,Icon:Information.png,DefaultObjectLayoutStyle:980163c2-2688-465d-9383-e5ad4dbf631f,Notes:This is
I have an ASP .Net Webservice which returns a System.Data.DataTable like object (contains rows
I have a web page which uses in PHP and a jQuery DataTable to
I have datatable with column name tag and 100 rows of data.I need to
I have a Datatable in my C# program that I would like to INSERT
I have a DataTable MyDT like below: string MyConString = SERVER= + sConfig_hostname +

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.