public UserProfile GetProfile(decimal userId) { var profile = new UserProfile(); using (var connection = new SqlConnection(_connectionstring)) { connection.Open(); var command = new SqlCommand(string.Format("select * from userprofile where id = {0}", userId) , connection); var ds = new DataSet(); var adapter = new SqlDataAdapter(command); adapter.Fill(ds); if (ds.Tables.Count > 0) { if (ds.Tables[0].Rows.Count > 0) { var data = ds.Tables[0].Rows[0]; profile.Id = data.AsDecimal("userid"); profile.StreetAddress = data.AsString("streetaddress"); profile.Landmark = data.AsString("landmark"); profile.City = data.AsString("city"); profile.State = data.AsString("state"); profile.Pincode = data.AsDecimal("pincode"); } } } return profile; }
public string Signup(decimal mobileNumber, string password, UserProfile profile) { return "success"; }