-
Dec 5th, 2018, 12:31 AM
#1
Thread Starter
Junior Member
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
-
Dec 5th, 2018, 03:16 AM
#2
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
-
Dec 5th, 2018, 04:26 AM
#3
Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|