Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

SQL database from c#.net

Name: trpCdr !!4Kp5t1d7B7ll/+r 2007-04-19 21:21 ID:7CesmpmX

i haev a problem in my c# program i keep getting an exception
the point of the program is to: Write a Windows form application that displays the items on order for which there is insufficient stock in inventory to process the orders.  When the button is pressed, the following information about out-of-stock items should be displayed: Item number, Item description, Quantity ordered, Quantity on hand.

i created a class invalid that stores the data values nessisary

Name: trpCdr !!4Kp5t1d7B7ll/+r 2007-04-19 21:23 ID:7CesmpmX

       private void button1_Click(object sender, EventArgs e)
        {
            int c = 0;
            string sConnection;
            sConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=ComputerStore.mdb";

            OleDbConnection dbConn;
            dbConn = new OleDbConnection(sConnection);
            dbConn.Open();



            string s1;
            invalid item;

            s1 = "SELECT Orders.itemID, Sum(Orders.quantity) AS totQuantity ";
            s1 = s1 + "FROM Orders ";
            s1 = s1 + "GROUP BY Orders.itemID ";
            s1 = s1 + "ORDER BY Orders.itemID;";

            OleDbCommand Query1;
            Query1 = new OleDbCommand();
            Query1.CommandText = s1;
            Query1.Connection = dbConn;
            string s2;

            s2 = "SELECT Inventory.itemID, Query1.totQuantity, Inventory.description, Inventory.quantity";
            s2 = s2 + "FROM Query1 INNER JOIN Inventory ON Query1.itemID = Inventory.itemID Where Query1.totQuantity > Inventory.quantity";
            s2 = s2 + "ORDER BY Inventory.itemID;";


            OleDbCommand dbCmd;
            dbCmd = new OleDbCommand();
            dbCmd.CommandText = s2;
            dbCmd.Connection = dbConn;

            OleDbDataReader dbReader;
            dbReader = dbCmd.ExecuteReader();

            while (dbReader.Read())
            {//retrieve records 1-by-1
                c++;
                item = new invalid(c, dbReader["itemID"].ToString(),
                    dbReader["description"].ToString(),
                    dbReader["totQuantity"].ToString(),
                   dbReader["quantity"].ToString());
                this.lstBox.Items.Add(item);
            }
            dbReader.Close();
            dbConn.Close();
        }
}

Name: trpCdr !!SDcQmWfSNn3CBh6 2007-04-19 21:26 ID:7CesmpmX

any halp would be appreciated

Name: Anonymous 2007-04-19 21:37 ID:lRSN3M9S

But is it Touring complete?

Name: Anonymous 2007-04-19 21:52 ID:7CesmpmX

yes?

Name: Anonymous 2007-04-20 5:45 ID:gPbqvE90

are you going to tell us what the exception is?

Name: Anonymous 2007-04-20 6:44 ID:HghpQltd

>>4
I believe it is so, as C# is similar to C++, a Touring-complete extension to C.

Name: Anonymous 2007-04-20 9:16 ID:oIbpFAf+

>>4
Ducks are Touring complete. They move across a (theoretically) infinite river in either direction. They have memory. In each step, they can catch fish, take a dump, or quack.

Name: Anonymous 2007-04-20 14:37 ID:R+KqPjEg

unsafe class ぬるぽ{
 static int Main(){
  int i=0;
  int *p=(int *)i;
  return *p;
 }
}

Name: Anonymous 2007-04-20 14:58 ID:Heaven

>>9
improved version
unsafe class ぬるぽ{
 static int Main(){
  return *(int *)0;
 }
}

Name: Anonymous 2009-09-02 21:06

Testing

Name: ​​​​​​​​​​ 2010-09-07 20:18

Name: Anonymous 2010-11-02 17:24

Name: Anonymous 2010-12-09 9:08

Name: Sgt.Kabu佚赵kiman莄 2012-05-29 0:27

Bringing /prog/ back to its people
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy

Don't change these.
Name: Email:
Entire Thread Thread List