|
Create a data adapter to the destination table and update the adapter as -
DataAdapter.Update( dataSet ).
|
|
|
|
|
If the XML is produced from DataSet.WriteXml, you can reconstruct it at the other end using DataSet.ReadXml. It's probably a good idea to emit the schema so that if the web service is updated to have extra columns or tables, it doesn't just crash existing clients.
|
|
|
|
|
I have a project wiht 3 tabs.
When I push the 2nd tab, I want to up pop a messagebox.
How can I do this?
Kiter
|
|
|
|
|
|
Maybe a TabControl has a bunch of Events, and fires one or more of them when you switch to another tab? That is what I have come to expect from WinForm Controls.
Did you bother reading some of the documentation?
|
|
|
|
|
hi
For Example My Tabcontrol name is TBC1
so
1. select TBC1 and go to Events on Propertes windows
2. Click the SelectedTabPageChanged events
3. and this step write the flowing code
....
if(TBC1.SelectedTabPageIndex==1)
MessageBox.Show("You select 2nd Tab of Tab Control");
//The First Tab index=0
|
|
|
|
|
|
I'm creating a program in C# that do not allow intersecting lines. How will I modify my code? Thank you.
I've already uploaded the whole source code of my program HERE (http://www.mediafire.com/?2g52fiqanma3hkx[^]) for you to check the other class I've included.But here's the code for the drawing process:
<pre lang="c#">
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication2
{
public partial class Form3 : Form
{
private Boolean _calculateDouglasPeuckerReduction = false;
private List<WindowsFormsApplication2.PointEnhanced> _amerenPoints = new List<WindowsFormsApplication2.PointEnhanced>();
public Form3()
{
InitializeComponent();
}
protected override void OnPaint(PaintEventArgs e)
{
List<System.Drawing.Point> drawingPoints = new List<System.Drawing.Point>();
foreach (WindowsFormsApplication2.PointEnhanced point in _amerenPoints)
{
drawingPoints.Add(new System.Drawing.Point(Convert.ToInt32(point.X), Convert.ToInt32(point.Y)));
}
if (drawingPoints.Count > 2)
{
e.Graphics.DrawLines(new Pen(Brushes.Black, 2), drawingPoints.ToArray());
lblOriginal2.Text = drawingPoints.Count.ToString();
if (_calculateDouglasPeuckerReduction)
{
List<WindowsFormsApplication2.PointEnhanced> points = Utility2.DouglasPeuckerReduction(_amerenPoints, Convert.ToDouble(nudTolerance2.Value));
drawingPoints = new List<System.Drawing.Point>();
foreach (WindowsFormsApplication2.PointEnhanced point in points)
{
drawingPoints.Add(new System.Drawing.Point(Convert.ToInt32(point.X), Convert.ToInt32(point.Y)));
}
e.Graphics.DrawLines(new Pen(Brushes.Red, 2), drawingPoints.ToArray());
lblSimplified2.Text = drawingPoints.Count.ToString();
}
}
base.OnPaint(e);
}
private void Form3_MouseMove(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
_amerenPoints.Add(new WindowsFormsApplication2.PointEnhanced(e.X, e.Y));
this.Invalidate();
}
}
private void Form3_MouseUp(object sender, MouseEventArgs e)
{
_calculateDouglasPeuckerReduction = true;
this.Invalidate();
}
private void Form3_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
_amerenPoints.Clear();
_calculateDouglasPeuckerReduction = false;
}
}
private void nudTolerance2_ValueChanged(object sender, EventArgs e)
{
this.Invalidate();
}
private void Form3_Load(object sender, EventArgs e)
{
}
}
}
|
|
|
|
|
Please give more detail about what problem you are trying to solve, and why your code does not work.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
You need to find a solution for two equations with two unknown variables.
here's a sample[^].
If it has a solution, they intersect, if not they don't.
Hope this helps.
V.
|
|
|
|
|
One negative sentence does not constitute a program specification, so I can't help you out; please explain what your program is supposed to do, and how it deviates from your expectations.
BTW: you should keep Paint handlers as simple as possible, since it probably will be called a large number of times when some window activity occurs on your system. Whatever needs to be calculated, should be calculated in advance. And memory allocations in there should be minimal too, example: don't call ToArray() in a Paint handler. Finally, objects that offer a public Dispose() method should be disposed of, which you don't in e.Graphics.DrawLines(new Pen... ; it is much better to create such small objects once, and keep them around as class members (say "blackPen2" and "redPen2").
|
|
|
|
|
hello word of Codeproject!
i have windows app (C#) with sql server 2008 and wanna to convert it to android so i can use my program on my htc.
what is the solution ?
thanks!
|
|
|
|
|
Two simple steps:
1. Learn Android
2. Convert the program
Done!
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
do we have some app that can convert it to android (monodroid)?
|
|
|
|
|
No there isn't. A touch based app is a lot different to a desktop app. You'll have to rewrite, especially as you are using SQL Server.
|
|
|
|
|
+5
|
|
|
|
|
No, there is no tool to do the conversion for you.
You'll have to rewrite the entire app from scratch, by hand.
|
|
|
|
|
I would suspect a potential redesign as well since if the Android phone can access the database then so can any internet based app and exposing a database directly to the internet is not something that one should do casually.
|
|
|
|
|
Probably the easiest way is create a Web GUI for the existing application and use the HTC to browse to that webapp. (if that is an option)
V.
|
|
|
|
|
Hi,
This has baffled me for hours ...
I wrote an addin for an existing program, and when I launch it, it steals focus away from the parent program, even when it is minimized, which I don't want.
I would prefer for it to not steal focus, so that I can click on menu items of the parent program regardless, or for it to at least release focus when I minimize it. Is this possible?
Thanks for reading.
|
|
|
|
|
What do you mean by an addin for an existing program?
turbosupramk3 wrote: when I launch it, it steals focus away from the parent program
That's the way Windows is designed to work, why would you not expect it?
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
It's not that I don't expect it, it's that I don't want it or I at least want it to release focus if I minimize the window
|
|
|
|
|
turbosupramk3 wrote: I at least want it to release focus if I minimize the window
Then you need to capture that action and somehow pass the focus back to the parent. However, you still have not explained how all this fits together so I cannot offer much more than that.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
I used Form.Show() instead of Form.ShowDialog() after I found out one was for a modal form and one for a non-modal form. This seems to have fixed that issue.
Thank you for your help.
|
|
|
|
|
It very difficult to decipher what question you are really asking but for what it's worth here is my interpretation.
1) By "addin" you mean an assembly containing the definition of a form.
2) By "launch" you mean display the form.
3) By "steal focus" you mean that the main form of the application is inaccessible until the addin's form is closed.
Based on (3) the addin's form has been displayed via ShowDialog and what you observe is the expected behaviour.
One part of the solution to your problem will be to display the addin form non-modally via the Show method.
However giving the user the ability to access both the addin and main forms will present new problems and you will need to decide what actions are allowable when the addin form is open. For example, will it be reasonable to let the user terminate the application?
Alan.
|
|
|
|