Results 1 to 3 of 3

Thread: Runing a webservice (in my host) by poststring in b4a

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2018
    Posts
    25

    Question Runing a webservice (in my host) by poststring in b4a

    hello

    i was asked this question several times. but nobody reply me.
    i write a webservice and upload it to my host, by asp.net. it works fine.
    now i want to use it by B4A.
    i write bellow lines. but job1.Success is false. why?


    b4a code:
    //---------------------------------
    Dim job1 As HttpJob
    job1.Initialize("", Me)
    Dim ConString As String = "Data Source= ASPNETDB3.mssql.somee.com;Initial Catalog=ASPNETDB3;User ID=a;Password=***;"
    job1.PostString("http://mywebsite.com/MYServices2.asmx?op=insert_into_test_tbl2","conString =" & ConString & "&name=" & "a" & "&grade=" & 3)
    Wait For (job1) JobDone(job1 As HttpJob)
    If job1.Success Then
    a=job1.GetString
    End If
    job1.Release


    webservice code:
    //-----------------------------------
    [WebMethod]
    public void insert_into_test_tbl2(string conString, string name, int grade)
    {
    con = new SqlConnection(conString);
    SqlCommand cmd = con.CreateCommand();
    SqlTransaction tr;


    string comm = "insert into test_tbl (name, grade) VALUES(N'" +
    name + "', " +
    grade + ") ";

    cmd.CommandText = comm;

    if (con.State == ConnectionState.Closed)
    con.Open();

    tr = con.BeginTransaction();
    cmd.Transaction = tr;
    cmd.ExecuteNonQuery();
    tr.Commit();

    }


    thanks

  2. #2
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,901

    Re: Runing a webservice (in my host) by poststring in b4a

    Maybe nobody replies because this is a VB forum? Either VB6 or VB.Net
    You should try a B4A forum

  3. #3
    Member
    Join Date
    Dec 2010
    Posts
    41

    Re: Runing a webservice (in my host) by poststring in b4a

    was asked this question several times. but nobody reply me.
    ???
    I actually replied here: http://www.vbforums.com/showthread.p...=1#post5337899

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width