locked
Need to create a class which takes some parameter RRS feed

  • Question

  • User1052662409 posted

    Hi all,

            Actually I need to keep some user info like, user_id, name, login time, etc. I need to insert all this in database.

            The problem is I need to use these all info on every form. I have all info in variables, I just want to make a class which can insert these all info in database.

            because it is not good to write whole code (insertion code) in every page. It would be easier to put an object of that class on every page.

         For that I was trying to make a class but can't access sqlcommand class

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Data;
    using System.Data.Sql;
    
    /// <summary>
    /// Summary description for User_Log
    /// </summary>
    public class User_Log
    {
    
        protected void Insert_Log(string User_Id, DateTime Login_Time, string Form_Name, string Action, string IP)
        {
          
    
        }
    
    	
    }
    

     

    Thanks

    Friday, August 8, 2014 12:02 AM

Answers

  • User-1360095595 posted

    Why you can't access SqlCommand? I don't understand what's stopping you. I think it's in system.data.sqlclient.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, August 8, 2014 2:04 AM

All replies

  • User-1360095595 posted

    Why you can't access SqlCommand? I don't understand what's stopping you. I think it's in system.data.sqlclient.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, August 8, 2014 2:04 AM
  • User1052662409 posted

    ahha.. Sorry MetalAsp.net

    I was using

    using System.Data.Sql;

    instead of

    using System.Data.SqlClient;

    Thanks....

    Friday, August 8, 2014 2:27 AM