Web Site Cannot implicitly convert type 'int' to & ...
Merhabalar, Visual Studio ile server üzerinde Web servis geliştirmeye çalışıyorum Linq to sql Class baglantısı gerçekledim
ve Url çalışıyor, Ek methodlar hazırlamak istiyorum. Veri tabanımda user_id verim nvarchar() , yeniyim ve veririnin çekilmesi esnasında problem yaşıyorum. Methodum aşağıda veriyi çekerken gerekli yapı bilgisinden yoksunum , Select sorugusnunda hatam var.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Script.Serialization;
/// <summary>
/// Summary description for WebServiceNYD
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
[System.Web.Script.Services.ScriptService]
public class WebServiceNYD : System.Web.Services.WebService
{
public WebServiceNYD()
{
//Uncomment the following line if using designed components
//InitializeComponent();
}
DataClassesDataContext dc = new DataClassesDataContext();
[WebMethod]
public string HelloWorld()
{
return "Hello World";
}
[WebMethod]
public string GetContant(string id)
{
var json = "";
//var newid = Int32.Parse(id);
var contact = from result in dc.mezura_users
where result.user_id = Int32.Parse(id) // HATA BURDA where result.user_id = id ... where result.user_id = newid // denendi
select result;
JavaScriptSerializer jss = new JavaScriptSerializer();
json = jss.Serialize(contact);
return json;
}
}