Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
0
Reply
Restful WCF service Refresh Problem
Mehmet Keles
Dec 5 2014 2:02 AM
764
Reply
I made a project in Windows Phone 8.1 to connect Remot SQL server via Restful WCF service, I can take all table from the server, and insert a row to table. After insert to table, I call All table again but last inserted row isnt be shown.
These are my codes,
[
ServiceContract
]
public
interface
IService1
{
[
OperationContract
]
[
WebGet
(
UriTemplate
=
"GetData"
,
RequestFormat
=
WebMessageFormat
.
Json
,
ResponseFormat
=
WebMessageFormat
.
Json
)]
List
<
tblKullan
i
c
i
lar
>
GetData
();
public
class
Service1
:
IService1
{
public
DataClasses1DataContext
data
{
get
;
set
;
}
List
<
tblKullan
i
c
i
lar
>
IService1
.
GetData
()
{
data
=
new
DataClasses1DataContext
();
var
q
=
(
from
a
in
data
.
GetTable
<
tblKullan
i
c
i
lar
>()
select
a
).
ToList
<
tblKullan
i
c
i
lar
>();
data
.
Dispose
();
data
=
null
;
return
q
;
}
And Calling the service...
private
async
Task
CallService
()
{
listbox1
.
ItemsSource
=
null
;
HttpClient
httpClient
=
new
System
.
Net
.
Http
.
HttpClient
();
HttpRequestMessage
request
=
new
HttpRequestMessage
(
HttpMethod
.
Get
,
"http://localhost:18901/Service1.svc/GetData"
);
HttpResponseMessage
response
=
await httpClient
.
SendAsync
(
request
);
string
data
=
await response
.
Content
.
ReadAsStringAsync
();
var
sonuc
=
JsonConvert
.
DeserializeObject
<
Kullanici
[]>(
data
);
listbox1
.
ItemsSource
sonuc
;
listbox1
.
UpdateLayout
();
sonuc
=
null
;
data
=
null
;
}
Anyone has an idea?
Thank you in advance
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
0
)
Next Recommended Forum
Tools requires for developing windows store apps
How to draw accurate shapes in Windows 8 store application