0

m trying to make dll class but in m facing errors in it plzzz help me to resolve the...i really need help!!!
my full code is:-

namespace selectfinedetails
{
public class TransactionService
{

SqlConnection cs;


private void OpenConnection()
{

cs = new SqlConnection();
cs.ConnectionString = "Data Source=IRIS-CSG-174;Initial Catalog=library_system;Integrated Security=True";

cs.Open();
}
public void calculatefine()
{
OpenConnection();
SqlCommand cmd = new SqlCommand();
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "Exec member_fine_detail";
cmd.Parameters.Add(new SqlParameter("member_id", SqlDbType.Int));

SqlDataReader sdr = cmd.ExecuteReader();
cmd.ExecuteNonQuery();
{
public class member_details
{
private void details()
{
member_details obj = new member_details();
SqlCommand cmd = new SqlCommand();
obj.member_id =cmd.ExecuteReader();
obj.fine_per_day=cmd.ExecuteReader();
return obj=cmd.ExecuteScalar();

in member_details class member_id and fine_per day need to be define..how to define them...

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by Knvn
0

You can not define a class inside a method.

public class Class1
{
   private void Method1()
   {
        //Body of Method1
   }

   private void Method2()
   {
        //Body of Method2
   }
}

public class Class2
{
  private void Method1()
   {
        //Body of Method1
   }

   private void Method2()
   {
        //Body of Method2
   }
}

Edited by Knvn: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.