KRayudu V

KRayudu V

  • NA
  • 155
  • 206.1k

Error:Can not implictly convert type string to RegFields.Fields

Aug 20 2012 12:50 AM
DataBaseObjects:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RegFields
{
  public class Fields
  {
  public string EmployeeName { get; set; }
  public string FirstName { get; set; }
  public string LastName { get; set; }
  public string UserName { get; set; }
  public string Password { get; set; }
  public string ConfirmPassword { get; set; }
  public string EmailId { get; set; }
  public string PhoneNo { get; set; }
  public string Address { get; set; }
  }
}


DBLayer
:
 public static DataSet GetLogin(string Emailid,string Password)
  {
 
  string spName = "sel_login7";
  SqlParameter paraemail = new SqlParameter("@Emailid", SqlDbType.VarChar, 50);
  SqlParameter parapwd = new SqlParameter("Password", SqlDbType.VarChar, 50);
  paraemail.Value = Emailid;
  parapwd.Value = Password;
  DataSet ds = SqlHelper.ExecuteDataset(connection, CommandType.StoredProcedure, spName, paraemail,parapwd);
  ds.Tables[0].TableName = "PlannIT";
  return ds;

  }

BOLayer:


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RegConnection;
using RegFields;
using System.Data;

namespace DataBase
public class Data
  {
 
 public DataSet  LoginBO(string Emailid,string Password)
  {
  return  DataBaseHelper.GetLogin(Emailid,Password);
 
  }

}

ControllerLayer:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RegFields;
using RegConnection;
using DataBase;

namespace Reg
{
  public class LoginDemo
  {
  Data d = new Data();
  public string  GetLoginCtrl(string EmailId, string Password)
  {
  return d.LoginBO(EmailId,Password).ToString();
  }
  }
}



using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Reg;
using RegFields;



public partial class LoginApp : System.Web.UI.Page
{
  LoginDemo ld = new LoginDemo();
  Fields f = new Fields();
  protected void Page_Load(object sender, EventArgs e)
  {

  }
  public int Validation_Login(string EmailId, string Password)
  {
  int result = 0;
  f.EmailId = txxtemail.Text.Trim();
  f.Password = txtpwd.Text.Trim();
    f =ld.GetLoginCtrl(EmailId, Password);  //Error:Error:Can not implictly convert type string to RegFields.Fields
  }
  protected void btnSubmit_Click(object sender, EventArgs e)
  {
  Validation_Login(txxtemail.Text, txtpwd.Text);
  }
}
Data d = new Data();
  public string  GetLoginCtrl(string EmailId, string Password)
  {
  return d.LoginBO(EmailId,Password).ToString();
  }

Answers (1)