16,012,468 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Avinash8 (Top 5 by date)
Avinash8
17-Jun-13 2:27am
View
Deleted
my gmail id is singh.avinaash46@gmail.com
Avinash8
17-Jun-13 2:01am
View
ok pls chek this, I m getting the same error:
service1.svc.cs code is:
public class Service1 : IService1
{
BussinessMobileWeb _obj = new BussinessMobileWeb();
[WebMethod]
public List<t_country_cmn> getcountrybyid()
{
DataTable dt = _obj.CountryList();
var lstGridData = new List<t_country_cmn>(dt.Rows.Count);
lstGridData.AddRange(from DataRow in dt.Rows
select new t_country_cmn(row[country_name],
row[country_desc],
row[country_telecom_code],
row[date_format],
row[fnb_type_sk],
row[country_code],
row[is_sms_notification],
row[distance_measurement_unit]));
// List rows = dt.Rows.Cast().ToList();
return lstGridData.ToList();
}
}
my iservice.cs code is:
namespace JSONWebService
{
// NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
[ServiceContract]
public interface IService1
{[OperationContract]
[WebInvoke(Method = "GET", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate = "GetAllCountries")]
List<t_country_cmn> getcountrybyid();
}
my customer.cs file where I have declared t_country_cmn class
namespace JSONWebService
{
[DataContract]
public class t_country_cmn
{
//t_country_cmn(int country_sk, int currency_sk, string country_name, string country_desc, string country_telecom_code, string date_format, string fnb_type_sk, string country_code, string is_sms_notification, string distance_measurement_unit);
[DataMember]
public int country_sk { get; set; }
[DataMember]
public int currency_sk { get; set; }
[DataMember]
public string country_name { get; set; }
[DataMember]
public string country_desc { get; set; }
[DataMember]
public string country_telecom_code { get; set; }
[DataMember]
public string date_format { get; set; }
[DataMember]
public string fnb_type_sk { get; set; }
[DataMember]
public string country_code { get; set; }
[DataMember]
public string is_sms_notification { get; set; }
[DataMember]
public string distance_measurement_unit { get; set; }
}
}
Avinash8
17-Jun-13 0:22am
View
thnks RelicV, I tried ur code
[WebMethod]
public List<t_country_cmn> getcountrybyid()
{
DataTable dt = _obj.CountryList();
var lstGridData = new List<t_country_cmn>(dt.Rows.Count);
lstGridData.AddRange(from DataRow in dt.Rows
select new t_country_cmn(row[country_name],
row[country_desc],
row[country_telecom_code],
row[date_format],
row[fnb_type_sk],
row[country_code],
row[is_sms_notification],
row[distance_measurement_unit]));
// List<t_country_cmn> rows = dt.Rows.Cast<t_country_cmn>().ToList();
return lstGridData;
}
I am getting following error, suggest me what is wrong in this:
Error 1 Could not find an implementation of the query pattern for source type 'System.Data.DataRowCollection'. 'Select' not found. Consider explicitly specifying the type of the range variable 'DataRow'. /Service1.svc.cs
Also I would like to ask u if there is a way to get data from database directly into the list type or any other type to return json?? At present I m getting data from database into data table and then... as u can see in the above code I have pasted. My priority is to make the web service as fast as possible.
Avinash8
14-Oct-12 23:33pm
View
FB.logout(function(response) {
// user is now logged out
});
i have written the above code on my .aspx page, and called the above script on my websites sign out button click event, but its not working.
Avinash8
11-Oct-12 6:49am
View
I have written the code
FB.logout(function(response) {
// user is now logged out
});
on my aspx page bt nothing happens.
i think i m missing something so if u can give me an example, it will help me more.