I'm running this code where basically I have a stored procedure which is inserting a new row into the table member
. I have posted the code of the method from C# to call the stored procedure and the code where I'm calling that method:
Stored procedure:
[AutoComplete(true)]
public void AddNewMember(Member cm)
{
SqlCommand cmd = new SqlCommand();
SqlDataAdapter da = new SqlDataAdapter();
try
{
this.Connection.BeginTransaction();
this.InitializeConnection();
cmd = new SqlCommand("sp_addNewMember", this.Connection);
cmd.Parameters.Add(new SqlParameter("@memberID", cm.MemberID));
cmd.Parameters.Add(new SqlParameter("@userID", cm.UserID));
cmd.Parameters.Add(new SqlParameter("@dateJoined", cm.DateJoined));
cmd.Parameters.Add(new SqlParameter("@Duties", cm.Duties));
cmd.CommandType = CommandType.StoredProcedure;
da.InsertCommand = cmd;
ContextUtil.SetComplete();
}
catch (Exception ex)
{
ContextUtil.SetAbort();
}
Calling the method:
DataLayer.Member cm = new DataLayer.Member();
cm.MemberID = Guid.NewGuid();
cm.UserID = new Guid(txtUserID.Text);
cm.DateJoined = Convert.ToDateTime(txtDateJoined.Text);
cm.Duties = txtDuties.Text;
DataLayer.AddMember acm = new DataLayer.AddMember();
acm.AddNewMember(cm);
Exception that gets thrown on the acm.AddNewMember()
line:
System.Runtime.Serialization.SerializationException: Unable to find assembly 'DataLayer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=536d0c71bd79a82e'
Do someone know what the problem is please?