Hi Vuysiwamb,
i alredy created sliverlight enable wcf service like this i have one class rrf1 in that
public class RRF1
{
[DataMember]
public List<ddlLocation> LocationList { get; set; }
}
i created one class . that i implemented in
[DataContract]
public class ddlLocation
{
private int _key;
private string _value;
[DataMember]
public int Key
{
get
{
return _key;
}
set
{
_key = value;
}
}
[DataMember]
public string Value
{
get
{
return _value;
}
set
{
_value = value;
}
}
}
and Declaration
#region Method Declaration
[ServiceContract]
public interface IRRFInsert
{
[OperationContract]
List<ddlLocation> getLocationDropdown();
}
and i used
#region Getting Location Values in to the dropdown
public List<ddlLocation> getLocationDropdown()
{
List<ddlLocation> ddlLocationList = new List<ddlLocation>();
SqlConnection objCon = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["ConnStr"].ToString());
DataSet dsLocation = new DataSet();
SqlCommand cmdLocation = new SqlCommand();
cmdLocation.Connection = objCon;
cmdLocation.CommandText = "usp_Synapse_REC_GetddlLocation";
cmdLocation.CommandType = CommandType.StoredProcedure;
SqlDataAdapter adaLocation = new SqlDataAdapter(cmdLocation);
//"select LOCATION_ID_PK, LOCATION_NAME from sip_Location_master ORDER BY LOCATION_NAME"
try
{
objCon.Open();
adaLocation.Fill(dsLocation);
for (int i = 0; i < dsLocation.Tables[0].Rows.Count; i++)
{
ddlLocation obj = new ddlLocation();
obj.Key = Convert.ToInt32(dsLocation.Tables[0].Rows[i]["LOCATION_ID_PK"]);
obj.Value = dsLocation.Tables[0].Rows[i]["LOCATION_NAME"].ToString();
ddlLocationList.Add(obj);
}
}
catch
{
}
finally
{
cmdLocation.Dispose();
objCon.Close();
objCon.Dispose();
}
return ddlLocationList;
}
#endregion
and i gave ref to client bin.. it's working fine.. but i don't want like this every time i don't want creat connect,command.. ect.. that want i want one framework layer , bussness layer, sevice layer to avoid single layer . i think u got my question :P . please help me
Thanks
kalyani
kalyani.
Kalyani, if this helps please login to Mark As Answer. | Alert Moderator