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

  • SEARCH
  • Home
  • 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 6846757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:39:45+00:00 2026-05-27T00:39:45+00:00

I am sending some data from windows mobile to webservice. Now i want to

  • 0

I am sending some data from windows mobile to webservice. Now i want to write a method in webservice to insert those values into sql database . How to proceed. please help

  • 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-05-27T00:39:46+00:00Added an answer on May 27, 2026 at 12:39 am

    there is good book called practical database programming with visual c#.NET by ying bai.

    //base class
    public class SQLInsertBase
    {
      public bool SQLInsertOK;
      public string SQLInsertError;
      public string lat;
      public string lon;
      public string id;
      public SQLInsertBase()
    {
        //
        // TODO: Add constructor logic here
        //
       }
    }
    
    
    
      [WebMethod]
    public SQLInsertBase GetSQLInsertCourse(string id,string lat,string lon)
    {
        string cmdString = "INSERT into Location values(@id,@latitude,@longitude)";
        SqlConnection sqlConnection = new SqlConnection();
        SQLInsertBase GetSQLResult = new SQLInsertBase();
        SqlDataReader sqlReader;
        GetSQLResult.SQLInsertOK = true;
        sqlConnection = SQLConn();
        if (sqlConnection == null)
        {
            GetSQLResult.SQLInsertError = "Database connection is failed";
            ReportError1(GetSQLResult);
            return null;
        }
        SqlCommand sqlCommand = new SqlCommand(cmdString, sqlConnection);
        sqlCommand.CommandType = CommandType.Text;
        sqlCommand.Parameters.Add("@id", SqlDbType.Text).Value = id;
        sqlCommand.Parameters.Add("@latitude", SqlDbType.Text).Value = lat;
        sqlCommand.Parameters.Add("@longitude", SqlDbType.Text).Value = lon;
        int result = sqlCommand.ExecuteNonQuery();
      //  if (sqlReader.HasRows == true)
       //     FillCourseDetail(ref GetSQLResult, sqlReader);
        if (result == 0)
        {
            GetSQLResult.SQLInsertError = "cannot update ";
            ReportError1(GetSQLResult);
        }
       /* else
        {
            GetSQLResult.SQLInsertError = "No matched  found";
            ReportError1(GetSQLResult);
        }*/
      //  sqlReader.Close();
        sqlConnection.Close();
        sqlCommand.Dispose();
        return GetSQLResult;
    }
    
    
     protected SqlConnection SQLConn()
      {
        string cmdString =     ConfigurationManager.ConnectionStrings["sql_conn"].ConnectionString;
        SqlConnection conn = new SqlConnection();
        conn.ConnectionString = cmdString;
        conn.Open();
        if (conn.State != System.Data.ConnectionState.Open)
        {
            MessageBox.Show("Database Open  failed");
            conn = null;
        }
        return conn;
    }
    
    
    protected void ReportError1(SQLInsertBase ErrSource)
    {
        ErrSource.SQLInsertOK = false;
        MessageBox.Show(ErrSource.SQLInsertError);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing simple Windows Service sending and receiving data from remote web service. I
I am 'sending' some data in a url: foo.htm?mydata From searching around I know
Windows Mobile 6.5 I have a process which uses System.Threading.Timer upload some data to
I want to send some data from one HTML page to another. I am
I'm using Google App Engine to fetch some data. Before sending the data from
I'm sending some data to an external URL using Curl. The server sends me
I got problem with sending data in Android using httpPost. I found some example,
Having some trouble sending properly formatted HTML e-mail from a PHP script. I am
I am starting an activity from one by passing some data in the intent.
I have a simulator application which writes some enrypted data into a text file.

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.