I found the answer: SOLUTION: 1. Right Click Properties on tablename.mdf in Solution Explorer 2. Set the "Copy to Output Directory" property to "Copy if newer" 3. Run the program, and it should work in the IDE.
danielhasdibs
Posts
-
Problem saving changes to a database VS C# 2005 -
Problem saving changes to a database VS C# 2005Here is what I do: I open a new project, I create a database, I enter one table into the database, I add three or four records to the table, I add the database as a data source, I drag the table from the data source to the form to create a datagridview, I run the program, I edit/add records on the form and click the Save button from the binding navigator, I close the program, I re-open the program, and the changes are not there. What am I missing? Here's the code for the save button click event:
private void customerBindingNavigatorSaveItem_Click(object sender, EventArgs e) { this.Validate(); this.customerBindingSource.EndEdit(); this.customerTableAdapter.Update(this.myCompanyDataSet.Customer); }
-
Problem saving changes to a database VS C# 2005Here is what I do: I open a new project, I create a database, I enter one table into the database, I add three or four records to the table, I add the database as a data source, I drag the table from the data source to the form to create a datagridview, I run the program, I edit/add records on the form and click the Save button from the binding navigator, I close the program, I re-open the program, and the changes are not there. What am I missing?
-
Problem saving changes to a database VS C# 2005I'm no stranger to programming, but I am brand new to programming with databases. I use MS Visual C# 2005. I have tried making forms with datasets and table adapters and it looks just fine... that is, until I try to make a change. I have a simple form with a single datagridview. I edit the records, click the Save button on the binding navigator, the tableadapter.Update() method returns the correct number of updated rows, but when I close the program and re-open it, the changes aren't there. Am I leaving out something? Is there extra code needed? etc.? Thanks.
-
Saving changes to a database via Windows formsI'm no stranger to programming, but I am brand new to programming with databases. I use MS Visual C# 2005. I have tried making forms with datasets and table adapters and it looks just fine... that is, until I try to make a change. I have a simple form with a single datagridview. I edit the records, click the Save button on the binding navigator, the tableadapter.Update() method returns the correct number of updated rows, but when I close the program and re-open it, the changes aren't there. Am I leaving out something? Is there extra code needed? etc.? Thanks.
-
Taborder for Dynamically-Created ControlsThank you! Below is how I implemented it for anyone who needs it (this is in a splitcontainer -- spc_Questions):
for (cntr = 0; cntr <; NumControls; cntr++) { newTextBox = new System.Windows.Forms.TextBox(); newTextBox.Size = new Size(25, newTextBox.Size.Height); newTextBox.Location = new Point(spc_Questions.Panel1.Right - newTextBox.Size.Width - 10, cntr * setHeight); // Tag needed to identify controls newTextBox.Tag = cntr.ToString(); newTextBox.TextChanged += new EventHandler(newTextBox_TextChanged); newTextBox.Show(); spc_Questions.Panel1.Controls.Add(newTextBox); } void newTextBox_TextChanged(object sender, EventArgs e) { TextBox Text = sender as TextBox; ControlTexts[int.Parse(Text.Tag.ToString())] = Text.Text; }
Thank you, again! -
Taborder for Dynamically-Created ControlsHere's a sample of the SelectNextControl() method I used.
string[] textFromControl = new string[10]; Control nextControl = new Control(); spc_Questions.Focus(); for (cntr = 0; cntr <; NumControls; cntr++) { this.SelectNextControl(nextControl, true, true, true, true); nextControl = this.ActiveControl; nextControl.Focus(); textFromControl[cntr] = nextControl.Text; }
-
Taborder for Dynamically-Created ControlsIt's set after I create the text box.
newTextBox.TabIndex = cntr;
I've been trying to use the SelectNextControl() method to get to each textbox control, but it keeps selecting the splitcontainer instead of the textboxes. -
Taborder for Dynamically-Created ControlsQuestion = How?
-
Taborder for Dynamically-Created ControlsMy code creates textboxes based on data from a file. I need to be able to retreive the text from each dynamically-created textbox. By the way, each textbox is contained in a splitcontainer control (spc_Questions). Here is the code that creates each textbox:
for (cntr = 0; cntr <; NumQ; cntr++) { input = sr.ReadLine(); newTextBox = new System.Windows.Forms.TextBox(); newTextBox.Size = new Size(25, newTextBox.Size.Height); newTextBox.MaxLength = 1; newTextBox.CharacterCasing = CharacterCasing.Upper; newTextBox.TabStop = true; newTextBox.TabIndex = cntr; newTextBox.Location = new Point(spc_Questions.Panel1.Right - newTextBox.Size.Width - 10, vHeight); newTextBox.Tag = cntr.ToString(); newTextBox.Show(); spc_Questions.Panel1.Controls.Add(newTextBox); }
Any help would be appreciated. :) -
C# Interaction with Word on multiple versions (MS Office 2000/2003/2007)This program was originally written with library 11.0 -- it worked with computers that had MS Office 2003 and 2007, I updated it when I upgraded to MS Office 2007 using library 12.0, and now it does not work with MS Office 2003. How can I get it to work with 12.0? Thanks.
-
C# Interaction with Word on multiple versions (MS Office 2000/2003/2007)Clarification: "took it to another computer" means installed it onto another computer. Jeez, if you don't know what's wrong don't bother replying.
-
C# Interaction with Word on multiple versions (MS Office 2000/2003/2007)I have a program that creates and edits Microsoft Word documents. It was created with Microsoft Word 12.0 Object Library -- I had MS Office 2007 installed. I built it and it worked great on my computer. I took it to another computer (one that had MS Office 2003 installed) and it crashes when I tell the program to create the Word document. This is the error I get (in the Details section): System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Office.Interop.Word, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified. File name: 'Microsoft.Office.Interop.Word, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' Is there a way to make sure the program can be backward and forward compatible with regard to versions of Microsoft Word? Thanks.
-
Posting Software to the WebI'm decent at programming applications, but pretty ignorant when it comes to web programming. How do you do what you said?
-
Posting Software to the WebHi everyone. I recently started an online software business. I'd like for my customers to be able to purchase my software (via PayPal) and after the purchase, be directed to a link where they can download the software. I'd prefer one that had a blind link (one where you could not get to from anywhere else). I'm sure there are sites that offer such services, but I'm having a tough time finding any. I already have the payment transaction setup through PayPal, but I don't know how to handle the downloading of the software. Any suggestions? Thanks.
-
NotifyIcon does not respondThank you, thank you! Solution is above. Thanks to DaveyM69.
-
NotifyIcon does not respondI've tried the timer, but it still doesn't work. Could you give me a sample code that works for you using a timer (or a loop) and a NotifyIcon? Thanks.
-
NotifyIcon does not respondPlease see my last comment explaining what the program does.
-
NotifyIcon does not respondThis is a reminder program. On the MainFrame form, the user enters a time to be reminded. After the reminder is set (the user clicks OK), the window minimizes and hides. Then the program enters a loop checking the difference in timespan. When the timespan.minutes is less than one, the reminder activates. I had the thread sleeping between iterations just to keep the memory usage down, but even when I remove the sleep methods, the icon does not respond.
-
NotifyIcon does not respondI have tried the ShowInTaskbar approach, but still, no dice. I tried to "run to cursor" to the point where the double-click event occurs, but it never goes to it. So, obviously, the icon does not recognize any mouse clicks. Is there a way to ensure that it does?