|
I am new to Visual Studio so if this is a stupid question plese forgive me.
I used the Data explorer to create a relationship between 2 tables (Employee, EmployeeMiscData)I have in SQL server express. and Visual Studio 2005. I then drag and drop the two tables (detail Veiw) unto a form. I am able to use the binding navigator to move back and forth through the data.
my problem is when i try to insert a new record: After pressing the add new button on the navigator bar I can only insert a record in the parent table (Employee). The information entered into the other controls bound to EmployeeMiscData doesn't get saved.
I tried trapping the "AddingNew" event of the Employee bindingsource and then doing a "EmployeeMiscDataBindingSource.AddNew()". When I hit the save button I trap the event and then do this:
EmployeeMiscDataBindingSource.EndEdit();
EmployeeMiscDataTableAdapter.Update(venuesDataSet.EmployeeMiscData);
I get no error but nothing is getting saved into the SQL table.
I already spent twos looking for a solution.
thanks
|
|
|
|
|
I think you need to look into the code behind. Sounds like it should have worked ...
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi,
How the Winforms are used in real world applications? Can one provide me good examples of it.
Thanks in advance
|
|
|
|
|
Check out this[^], but there lots of examples[^].
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Or you could take a look at for example any application in Microsoft Office, those are pretty much real-life examples of winform applications.
|
|
|
|
|
The Microsoft Office applications are mostly written in non-managed C++, not a .Net language. So they are not Winform applications.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
My project has windows forms to collect data from a customer and then when the submit button is clicked,the data needs to be stored as an entry in a customer table in the backend.How should i do the databinding???plz help....
Alpana
|
|
|
|
|
You're going to have to be more specific. What database are you using? Are you doing this over a networking? What are you databinding? Break it down for us. Or try to search the articles for some basics if that is what you are looking for.
|
|
|
|
|
Dear Friends:
pnlChild is added to the children controls of pnlParent. However, when pnlParent is resized, its child panle pnlChild is not notified automatically. Why? Do I have to manually notify pnlChild of the resize event? Thanks!
using System.Windows.Forms
......
public class MyForm: Form
{
public Panel pnlParent;
public MyForm()
{
pnlParent = new Panel();
this.Resize += new System.EventHandler(MyForm_Resize);
}
private void MyForm_Resize(object sender, EventArgs e)
{
pnlParent.Size = new Size(.., ..); //parent panel is resized
}
public void AddChildControl()
{
Panel pnlChild = new Panel();
pnlChild.Resiz += new System.EventHandler(pnlChild_Resize);
pnlParent.Controls.Add(pnlChild);
....
}
private void pnlChild_Resize(object sender, EventArgs e)
{
... //is not called automatically when pnlParent is resized
}
}
|
|
|
|
|
Hi,
AFAIK if pnlChild is not anchored, not docked, and you want pnlParent to cause a
pnlChild resize, then you must invoke it, typically by assigning a new pnlChild.Size
in pnlParent_Resize().
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
I am writing code about a form.it similar to Paint of Window.i have a some problem,so i find code to look for my problem
leo
|
|
|
|
|
nta_3886 wrote: i have a some problem,so i find code to look for my problem
That's nice. Have a good trip then...
... or did you mean to tell us about the problem you're having with your code??
|
|
|
|
|
What is up with the original post? It makes no real sense. Is there a problem in there somewheres or does the OP want people to do his work for him, so he gets praises/fame for other's efforts?
"Find it your bloody self - immediately!" - Dave Kreskowiak
|
|
|
|
|
Yeah, I was thinking the same thing. Apparently his code needs to go on a "vision quest" to find the problems with itself.
|
|
|
|
|
Dave Kreskowiak wrote: "vision quest"
[Homer Simpson voice over] Mmmmmmm, vision quest [/Homer Simpson voice over]
"Find it your bloody self - immediately!" - Dave Kreskowiak
|
|
|
|
|
thank your reply.my problem:i make a event draw a line
example
Point p=new Point();
Pen pe =new Pen(Color.Black,1);
private void mouseDown (object sender, MouseEventArgs e)
{
p = e.Location;
}
private void mouseUp(object sender, MouseEventArgs e)
{
Graphics g = this.CreateGraphics();
g.DrawLine(pe,p,e.Location);
g.Dispose();
}
this code draw a line from the location at Mouse Down to the location at the Mouse Up
When mouse move, I want alway have a line from location at Mouse Down to the location of Mouse at the moment.but when Mouse up,there is only a line.
It is similar to the draw a line in program Paint of Window.i can't write code.
If you know,please tell me quick
leo
|
|
|
|
|
Rephrase your question.
"Find it your bloody self - immediately!" - Dave Kreskowiak
|
|
|
|
|
I write a class inherit from CDHtmlDialog, and show a HTML page
but the HTML page include a lot of CSSs,JavaScripts,
so have some blemish:
Dialog show first, and after about 2~4 secs, then the HTML page is showed
when HTML page is not showed, the WebBrowser Control area is blank,it is unsightly.
I also try:
1.Add the HTML file into .exe as a resource, but it is as of old.
2.Reduce css and js, can resolve this problem,but it is the only way???
any ideas???
thanks..
|
|
|
|
|
what is the code in displaying this:12345
4321
321
21
1
|
|
|
|
|
Sounds like a classroom exercise. You are supposed to figure it out for yourself. Why not make an attempt and if it doesn't work show us the code then we'll help you out.
|
|
|
|
|
shen17 wrote: what is the code in displaying this:12345
4321
321
21
1
Do your own frigging homework!
If something like this is too challenging for you, go pick a different profession because if you cannot solve this on your own, real world problems in software development will be too much for you.
"Find it your bloody self - immediately!" - Dave Kreskowiak
|
|
|
|
|
I can tell you:
Console.WriteLine("12345");
Console.WriteLine("4321");
Console.WriteLine("321");
Console.WriteLine("21");
Console.WriteLine("1");
Greetings - Gajatko
Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.
|
|
|
|
|
LOL - I hope you're kidding ( and I hope he takes this to class and learns a valuable lesson )
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
And I hope he will not give it to a teacher as a solution of this excercise (or whatever it is)...
Greetings - Gajatko
Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.
|
|
|
|
|
if you have a simpler solution, don't hesitate and post it!
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|