TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Mehmet Keles
NA
4
3.5k
Restful WCF service Refresh Problem
Dec 5 2014 2:02 AM
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
Reply
Answers (
0
)
ExpanderView In wp8
Expander View in Windows Phone