Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
V

VonHagNDaz

@VonHagNDaz
About
Posts
1.1k
Topics
48
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • SQL Update Statement, OleDbDataAdapter, and ms access 2007
    V VonHagNDaz

    Hi guys, I'm trying to understand an Update query generated from vs2010. I'm new to sql and all of the msdn answers are hard-coded, and I need some help to do this with variable data. I've figured out my insert statement

    DataSet dataChanges = new UserData();
    dataChanges.DataSetName = "dataChanges";

                dataChanges = this.\_userDataSet.GetChanges(DataRowState.Modified | DataRowState.Added | DataRowState.Deleted);
    
                this.\_dbConnection.ConnectionString = this.\_connectionString;
                this.\_dbConnection.Open();
    
                //insert new rows
                OleDbCommand command = new OleDbCommand("INSERT INTO tblUsers(ID\_NAME, ID\_PASSWORD, ID\_RIGHTS, ID\_JOBS)VALUES(?, ?, ?, ?)", this.\_dbConnection);
                command.Parameters.Add(this.\_userDataSet.tblUsers.ID\_NAMEColumn.ColumnName,
                                        OleDbType.VarChar,
                                        this.\_userDataSet.tblUsers.ID\_NAMEColumn.MaxLength, 
                                        "ID\_NAME");
    
                command.Parameters.Add(this.\_userDataSet.tblUsers.ID\_PASSWORDColumn.ColumnName,
                                        OleDbType.VarChar,
                                        this.\_userDataSet.tblUsers.ID\_PASSWORDColumn.MaxLength,
                                        "ID\_PASSWORD");
    
                command.Parameters.Add(this.\_userDataSet.tblUsers.ID\_RIGHTSColumn.ColumnName,
                                        OleDbType.Integer,
                                        this.\_userDataSet.tblUsers.ID\_RIGHTSColumn.MaxLength, 
                                        "ID\_RIGHTS");
    
                command.Parameters.Add(this.\_userDataSet.tblUsers.ID\_JOBSColumn.ColumnName,
                                        OleDbType.Integer,
                                        this.\_userDataSet.tblUsers.ID\_JOBSColumn.MaxLength,
                                        "ID\_JOBS");
                this.\_dbAdapter.InsertCommand = command;
    

    _userDataSet is a typed dataset. The vs generated UPDATE query looks like this:

    //update rows;
    command = new OleDbCommand("UPDATE tblUsers SET ID_NAME = ?, ID_PASSWORD = ?," +
    "ID_RIGHTS = ?, ID_JOBS = ? WHERE ((ID_NAME = ?) AND" +
    "((? = 1 AND ID_PASSWORD IS NULL) OR (ID_PASSWORD = ?))" +
    "AND ((? = 1 AND ID_RIGHTS

    Database database visual-studio help question announcement

  • Comparing Table Entries Using C# and MS Access
    V VonHagNDaz

    Hey Guys, Saying I'm a rookie at databases would be giving me too much credit. That said, I'm working on a project where a manager can create a job for his employees. Each employee is stored in a table tblUsers and each job is stored in a table tblJobs. Now I know I have a few problems with the way my DB is set up. tblUsers has a primary key of UserName and tblJobs has a primary key of Job Descriptions. Each entry in tblJobs has a linked key, UserName from tblUsers is linked to Project lead from tblJobs. I have two ArrayLists, jobs and copyOfJobs. When a manager signs in, copyOfJobs is passed to what I call ManagerForm. In ManagerForm, the manager can make alterations to copyOfJobs, and once he exits, I want to compare jobs with copyOfJobs. The contents of jobs is pulled from an Access Database, then copied to copyOfJobs. Once ManagerForm is closed, I want to compare jobs to copyOfJobs. Durring the comparison I want to check if things such as project name, project lead, duedate for a particular assignment has changed. If changed, I want it removed from the database and reinserted with the new values. I'm completely stuck! Any advice/comments would be greatly appreciated. Here is some code to prove I've actually messed around with this before coming to you guys.

        public void GetUsers(ArrayList users)
        {
            object\[\] userData = new object\[4\];
    
            OleDbCommand dbCommand = new OleDbCommand("SELECT \* FROM tblUsers", this.\_dbConnection);
    
            try
            {
                OleDbDataReader dbReader = dbCommand.ExecuteReader();
    
                while (dbReader.Read())
                {
                    User currentUser = new User();
                    dbReader.GetValues(userData);
    
                    //get user name
                    currentUser.Name = userData\[0\].ToString();
                    //get password
                    currentUser.Password = userData\[1\].ToString();
                    //get rights
                    string temp = userData\[2\].ToString();
                    int rights = Convert.ToInt16(temp);
                    currentUser.Rights = (User.EN\_RIGHTS)rights;
                    //get jobs
                    //still thinking about this one
    
    
                    users.Add(currentUser);
                }
                dbReader.Close();
            }
            catch (Exception e)
            {
                String temp = String.Format("DBManager::GetUsers: {0}", e.Message);
    
    Database database csharp help career

  • attach a file to a windows form
    V VonHagNDaz

    Here is a scenario. Form1 is for the manager. From form1 he can enter a description of a project, assign a lead, and enter comments. With most projects, there are associated .doc, .pdf, or .xls files. By attach, I mean that the manager can add those files, similar to an email, so that the lead, from Form2 can see the files. I don't want the files to be viewable/opened from Form2, I'm looking for a way for the manager to add these files, and then have the project lead receive the files from Form2. Sorry if this is a confusing description, I do appreciate the help.

    [Insert Witty Sig Here]

    Managed C++/CLI winforms question

  • attach a file to a windows form
    V VonHagNDaz

    Hey Guys, I've done some Googling and some MSDN searches, but no luck. What I have is two Windows forms. I want to be able to attach a file/files from one of the forms, and then have the other form be able to see/open these attachments. Any ideas on which controls, data structures, or methods to use? I'm a bit stumped right now. I've investigated the FileDialog class, but I don't think that's what I need.

    [Insert Witty Sig Here]

    Managed C++/CLI winforms question

  • Static and Global Variables?
    V VonHagNDaz

    Hey guys, I have a question that's been plaguing me for a day or so. I'll try to explain as best as possible. No code this time, just some general questions. I have a hierarchy of Windows forms, MainForm->AdminForm->JobDetailsForm. JobDetailsForm requires objects from MainForm, and AdminForm is just a middle man. Is there a slick way to get information from an object in MainForm to JobDetails form without passing the object through AdminForm? The object is an ArrayList of Objects called Users. I set information in the MainForm, and then I get that information inside of JobDetailsForm. Currently I'm doing something similar to Pseudo Code: MainForm ArrayList users; ... new AdminForm(users); AdminForm ... //no operations on users new JobDetailsForm(users) JobDetailsForm ... //some operations on users AdminForm has no use for users, it simply displays some information unrelated to users. If possible, I'd also like the operations preformed in JobDetailsForm to be reflected in the users object used in MainForm. I'm thinking a global or static variable could solve this, but from what I understand, there are no global or static variables in managed C++/CLI. Any ideas or suggestions?

    [Insert Witty Sig Here]

    Managed C++/CLI question c++ winforms lounge

  • DateTime->Parse
    V VonHagNDaz

    I see, MSDN wasn't too clear on that. It lead me to believe temp would be modified. Thank you, 5's for both.

    [Insert Witty Sig Here]

    Managed C++/CLI json help question

  • DateTime->Parse
    V VonHagNDaz

    That works! I'm a bit confused as to why your code works and mine doesn't. What is the difference between SomeDateTimeObject.Parse, and DateTime::Parse?

    [Insert Witty Sig Here]

    Managed C++/CLI json help question

  • DateTime->Parse
    V VonHagNDaz

    Hey Guys, I'm having a little problem parsing a date and time from a string.

    		DateTime^ start = gcnew DateTime();
    
    		temp = "";
    		this->thisJob->getStartDate(temp);
    		start->Parse(temp);
    

    temp is "5/16/2011" however, after start->parse(temp) the value of start is always "1/1/1 0:0:0" I'm only interested in the date "5/26/2011". MSDN has several differnt "Parse" methods, and I've tried a few others, but the result is always "1/1/1 0:0:0" Sorry for the smileys, I think CP website is taking my returned string I'm typing into the question and converting it into some kind of smiley code.

    [Insert Witty Sig Here]

    Managed C++/CLI json help question

  • Passing an ArrayList by Reference? [modified]
    V VonHagNDaz

    That did the trick! I'm new to managed code and c++/CLI. All of these new operators are throwing me for a loop. Darn Windows forms projects!

    [Insert Witty Sig Here]

    Managed C++/CLI help question career

  • Passing an ArrayList by Reference? [modified]
    V VonHagNDaz

    Hi guys, I'm having a small problem, and I'd like to know what you guys think. User.h:

    void User::getJobs(ArrayList^ jobs)
    {
    jobs = this->jobs;
    }

    UserForm.h:

    UserForm(User^ currentUser)
    {
    InitializeComponent();
    //
    //TODO: Add the constructor code here
    //
    this->user = gcnew User();
    this->allJobs = gcnew ArrayList();

    		Job^ currentJob = gcnew Job();
    		ListViewItem^ item = gcnew ListViewItem();
    
    		this->user = \*currentUser;
    		**_this->user->getJobs(this->allJobs);_**
    
    		for(int i = 0; i < allJobs->Count; i++)
    		{
    			currentJob = (Job^)allJobs\[i\];
    
    			String^ temp = "";
    			currentJob->getCustomerName(temp);
    			item->SubItems->Add(temp);
    
    			temp = "";
    			currentJob->getProjectName(temp);
    			item->SubItems->Add(temp);
    
    			Job::EN\_PRIORITY^ priority = Job::EN\_PRIORITY::EN\_PRIORITY\_0;
    			currentJob->getPriority(priority);
    			switch(\*priority)
    			{
    			case Job::EN\_PRIORITY::EN\_PRIORITY\_0:
    				item->SubItems->Add("NONE");
    				break;
    			case Job::EN\_PRIORITY::EN\_PRIORITY\_1:
    				item->SubItems->Add("1");
    				break;
    			case Job::EN\_PRIORITY::EN\_PRIORITY\_2:
    				item->SubItems->Add("2");
    				break;
    			case Job::EN\_PRIORITY::EN\_PRIORITY\_3:
    				item->SubItems->Add("3");
    				break;
    			case Job::EN\_PRIORITY::EN\_PRIORITY\_4:
    				item->SubItems->Add("4");
    				break;
    			case Job::EN\_PRIORITY::EN\_PRIORITY\_5:
    				item->SubItems->Add("5");
    				break;
    			default:
    				item->SubItems->Add("NONE");
    				break;
    			}
    			listViewAllJobs->Items->Add(item);
    
    			//add time stuff once I figure it out
    		}
    	}
    

    I can see that when getJobs() completes job in Job.h equals the values I'm trying to retrieve, but once the function returns, this->allJobs is blank. Any ideas?

    [Insert Witty Sig Here]

    modified on Friday, May 13, 2011 8:54 AM

    Managed C++/CLI help question career

  • New Developer Setup
    V VonHagNDaz

    Again, thank you.

    [Insert Witty Sig Here]

    Running a Business question workspace tools career

  • New Company
    V VonHagNDaz

    Thank you, again, sorry for the cross post.

    [Insert Witty Sig Here]

    C / C++ / MFC question tools career workspace

  • New Company
    V VonHagNDaz

    Hi guys! Sorry, this is cross post, I wasn't sure where to put it and what looked like the appropriate forum hadn't had any activity in a few weeks. I've been programming professionally for 5 years, and all the companies that I've worked for in the past have had all the development tools in place before I arrived. I'm currently starting a new job, and the company wants me to develop some in house software for their use. My question is, how do I go about choosing the correct environment(VS2008, VS2008 Pro, VS2010?). Do we need MSDN licenses? What about SDK's? I know these seem like pretty basic questions, but all of the other companies I've worked for the IT department handled these issues, and I had no control over them. This is a small company, and their first attempt at software development, I don't want them to have to buy unnecessary tools, and I don't want to be halfway through a project before I realize I've missed a huge component.

    [Insert Witty Sig Here]

    C / C++ / MFC question tools career workspace

  • New Developer Setup
    V VonHagNDaz

    Hi guys! I've been programming professionally for 5 years, and all the companies that I've worked for in the past have had all the development tools in place before I arrived. I'm currently starting a new job, and the company wants me to develop some in house software for their use. My question is, how do I go about choosing the correct environment(VS2008, VS2008 Pro, VS2010?). Do we need MSDN licenses? What about SDK's? I know these seem like pretty basic questions, but all of the other companies I've worked for the IT department handled these issues, and I had no control over them. This is a small company, and their first attempt at software development, I don't want them to have to buy unnecessary tools, and I don't want to be halfway through a project before I realize I've missed a huge component.

    [Insert Witty Sig Here]

    Running a Business question workspace tools career

  • Interesting thing about Palm Pre Development
    V VonHagNDaz

    That's dependent on the amount of cards you have open. I keep about 4 open at all times and it only hangs a bit if they're all trying to update at once. Normally I'm streaming Pandora all the time, and I flip between email, messaging, and weather. The Mojo SDK is free to download and has a built in emulator. A lot of the stock apps are garbage, but the app store doesn't "officially" open for a few months. A really cool Easter egg is the Konami Code (up up down down left right left right b a start) is what you type to enter developer mode.

    [Insert Witty Sig Here]

    The Lounge html javascript hardware

  • Speaking of TxtSpeak [modified]
    V VonHagNDaz

    I can tell you as a true Southerner, there will never be a replacement for "yall". I can see your point, but I'm still going to cover my ears and hum anytime some one tries to defend that rubbish...

    [Insert Witty Sig Here]

    The Lounge question

  • Interesting thing about Palm Pre Development
    V VonHagNDaz

    I'm a Pre owner. FANTASTIC phone, but the build quality is extremely poor. Check out precentralDOTnet. They already have 100+ applications. It only took a week after release to root the device. There is a great pre dev wiki, forgot the address, and those guys are doing some really cool stuff: phone as modem, turning the phone into a web server, and it's very linux friendly. I recommend checking it out if you're really interested.

    [Insert Witty Sig Here]

    The Lounge html javascript hardware

  • Who invented this stupid english??
    V VonHagNDaz

    Whats worse is there are people who speak it. Yes, that's right, people actually sound out the abbreviations to make words, then use said words in conversation. As soon as those words end up in the dictionary, I'm moving and refusing to speak English ever again...

    [Insert Witty Sig Here]

    The Lounge com question

  • Normally I wouldn't mock somebody in the ASP.NET forum in the lounge...
    V VonHagNDaz

    Everyone chip in a few dollars and lets send this kid to some 3rd world heck hole, one way...

    [Insert Witty Sig Here]

    The Lounge csharp php asp-net wpf com

  • Poor little jocks
    V VonHagNDaz

    I'd cut the home economics, driver's ed, business typing, and computing for windows(excel, word, power point). They're useful, but people just take them to get credit hours, no one takes them seriously, so they would get the ax first.

    [Insert Witty Sig Here]

    The Back Room
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups