topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday October 4, 2024, 9:27 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - chedabob [ switch to compact view ]

Pages: [1]
1
Developer's Corner / Writing a simple driving game (help!!)
« on: October 09, 2007, 09:50 AM »
Right, so I'm trying my best to write a simple driving game in XNA (that's not important). Basically, it's a 2D top down game, but I'm struggling to get the vehicle to move in the direction it is facing. Does anybody have a formula that would give me the new coordinates based on the source position, rotation, and the distance to travel? I did try:

X = distance * cos(rotation)
Y = distance * sin(rotation)

but I just ended up with a vehicle that would rotate around the point, and sometimes it might just travel in the direction it was facing :p

2
Developer's Corner / ASP.NET Issues
« on: May 18, 2007, 11:04 AM »
I've been asked to code a form for a website. The form contains 40 or so textboxes, so I just wrote some really long INSERT query (if there is a better way, please suggest it) to insert them in. Now, I keep getting "Object reference not set to an instance of an object" on the following code

OleDbCommand theCommand = new OleDbCommand();
        theCommand.Connection = theConnection;
        theCommand.CommandText = @"INSERT INTO [SQLserverSQL].[dbo].[Records]
           ([computerName]
           ,[operatingSystem]
           ,[serialNumber]
           ,[hardwareManufacturer]
           ,[modelType]
           ,[warrantyExpiration]
           ,[serverFunction]
           ,[retailCorporate]
           ,[dcenterStoreLocation]
           ,[rackNumber]
           ,[supportGroup]
           ,[cellNumber]
           ,[Product Number]
           ,[localAdminID]
           ,[localAdminPW]
           ,[cpuNumber]
           ,[cpuType]
           ,[cpuSpeed]
           ,[networkAdapters]
           ,[speedDuplex]
           ,[primaryIP]
           ,[secondaryIP]
           ,[riloName]
           ,[riloIP]
           ,[totalMemory]
           ,[totalDiskSpace]
           ,[C_OS]
           ,[D_Data]
           ,[E_Apps]
           ,[networkCableID]
           ,[power]
           ,[changeWindow]
           ,[appName]
           ,[businessOwner]
           ,[appVendor]
           ,[appSupportGroup]
           ,[appFunction]
           ,[appCode]
           ,[specialRequirements])
     VALUES
           (" + computerName.ToString()
           + "," + operatingSystem.SelectedIndex.ToString()
           + "," + serialNumber.ToString()
           + "," + hardwareManufacturer.SelectedIndex.ToString()
           + "," + modelType.SelectedIndex.ToString()
           + "," + warrantyExpiration.ToString()
           + "," + serverFunction.SelectedItem.ToString()
           + "," + retailCorporate.SelectedItem.ToString()
           + "," + dCenterStoreLocation.SelectedItem.ToString()
           + "," + gridLocation.SelectedItem.ToString()
           + "," + supportGrp.ToString()
           + "," + cellPagerNumber.ToString()
           + "," + productNumber.ToString()
           + "," + localAdminID.ToString()
           + "," + localAdminPW.ToString()
           + "," + cpuNumber.SelectedItem.ToString()
           + "," + cpuType.SelectedItem.ToString()
           + "," + cpuSpeed.SelectedItem.ToString()
           + "," + netAdapters.SelectedItem.ToString()
           + "," + speedDuplex.SelectedItem.ToString()
           + "," + primaryIP.ToString()
           + "," + secondaryIP.ToString()
           + "," + riloName.ToString()
           + "," + riloIP.ToString()
           + "," + totalMemory.ToString()
           + "," + totalDiskSpace.ToString()
           + "," + C_OS.SelectedItem.ToString()
           + "," + D_Data.SelectedItem.ToString()
           + "," + E_Apps.SelectedItem.ToString()
           + "," + netCableID.ToString()
           + "," + power.ToString()
           + "," + changeWindow.ToString()
           + "," + appName.ToString()
           + "," + businessOwner.ToString()
           + "," + appVendor.ToString()
           + "," + appSupportGrp.ToString()
           + "," + appFunc.ToString()
           + "," + appCode.ToString()
           + "," + specReq.ToString() + ")";

It occurs on the third line, but I don't know what's causing it, as this is the way I've always done it before. Any ideas?

3
Developer's Corner / grr SQL and C#
« on: February 27, 2007, 12:10 PM »
So I have this code

string scope = null;
            try
            {
                OleDbCommand tableSearch = connection.CreateCommand();
                tableSearch.CommandText = "SELECT * FROM coursework WHERE DateDue BETWEEN '" + System.DateTime.Now.Date.ToString() +  "' AND '" + scope+ "'";//sql command
                //OleDbParameter todaysDate = new OleDbParameter();
                //tableSearch.Parameters.Add(todaysDate);
                //OleDbParameter dateDue = new OleDbParameter();
                //tableSearch.Parameters.Add(dateDue);//add a parameter
                //todaysDate.Value = System.DateTime.Now;
                if (whatScope == "week")
                {
                    //dateDue.Value = System.DateTime.Now.AddDays(7).ToLongDateString();//give the parameter a value
                }
                else if (whatScope == "month")
                {
                    //dateDue.Value = System.DateTime.Now.AddMonths(1).ToLongDateString();
                }
                else if (whatScope == "today")
                {
                    //dateDue.Value = System.DateTime.Now.ToLongDateString();
                    scope = System.DateTime.Now.Date.ToString();
                }
                OleDbDataReader reader = tableSearch.ExecuteReader();
                assignmentList.Items.Clear();
                while (reader.Read())
                    assignmentList.Items.Add(reader.GetString(0));
                reader.Close();
            }
            catch (OleDbException ex)
            {
                MessageBox.Show(ex.ToString());
            }

Im trying to get it so that it retrieves values from the DB between Today and X. The column DateDue is a Long Date column, but no matter what I try and put in the SQL query, I always get "Data Type Mismatch In Criteria Expression".

Any ideas?

4
Developer's Corner / Stupid database date picker
« on: January 17, 2007, 07:09 AM »
Right, so I have a date picker, for my database. The only problem is, despite the fact that the date is shown onscreen, its never passed into the database, unless the user clicks a value. See, its not normally a problem, but if the date selected is already correct, the average user won't change it. So then it doesn't go into the database, and when I search later, I can't find it, because there is no date.

So, is there an easy way to force the database to use the value shown onscreen?

5
Developer's Corner / C# Microcontroller
« on: January 07, 2007, 10:02 AM »
I know this seems like a daft question, but does there exist a microcontroller that will interpret c#? I know one exists for Java (Sunspot) but Java seems a little different to C#. The reason I ask is because I absolutely hate ASM with a passion.

Thanks

6
Developer's Corner / Gimme something simple to code
« on: December 09, 2006, 06:30 AM »
So, ive not been programming for very long (about 2 months) but I wanna practice a bit, but ive got no ideas. Post a simple app for me to code, and ill code it and upload :P

Pages: [1]