1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Data Types in C#

Discussion in 'C#' started by pradeep, May 21, 2007.

  1. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,292
    Likes Received:
    365
    Trophy Points:
    83
    I am saying its not an exact copy from the link you mentioned but yes the classification and the description of the data type is but that is hardly any problem because MSDN also states the same thing in the same manner.

    :iagree: and that is the reason all of them have been removed.
     
  2. samanatabaki

    samanatabaki New Member

    Joined:
    Apr 13, 2012
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    hello and thank you for your good discussion.
    The question I have is this. we say we can hold any data type in object data type. we can hold integers, string, char, decimal and many others. so why would we need other data types? why microsoft put all of those int, string, char, byte, single, and ... to .net library. there must be a reason and I will be happy if anyone could help me.
    thank you
     
  3. beelzebub

    beelzebub New Member

    Joined:
    Nov 17, 2012
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    You can use code:
    Using System.Data.SqlClient;
    using System.Collections.Specialized;
    using System.Text;

    Here’s the code block for deleting multiple records

    #region Multiple Delete
    private void DeleteRecords(StringCollection sc)
    {
    SqlConnection conn = new SqlConnection(GetConnectionString());
    StringBuilder sb = new StringBuilder(string.Empty);

    foreach (string item in sc)
    {
    const string sqlStatement = "DELETE FROM Customers WHERE CustomerID";
    sb.AppendFormat("{0}='{1}'; ",sqlStatement, item);
    }
    try
    {
    conn.Open();
    SqlCommand cmd = new SqlCommand(sb.ToString(), conn);
    cmd.CommandType = CommandType.Text;
    cmd.ExecuteNonQuery();
    }
    catch (System.Data.SqlClient.SqlException ex)
    {
    string msg = "Deletion Error:";
    msg += ex.Message;
    throw new Exception(msg);
    }
    finally
    {
    conn.Close();
    }
    }
    more help you can visit dapfor. com
     
  4. chinujhon

    chinujhon New Member

    Joined:
    Nov 2, 2012
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    Its very nice and interested discussion. Please add more information about reference types.
     

Share This Page