|
HI,
My aim is to bind two tables data into a single datagrid with specific column names .if any one knows how to do this please do let me know ........database is access
regards
sindhu tiwari
Always Innovative
|
|
|
|
|
Write a query which returns all the data you need from both tables.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I tried the code below which I got from MSDN:
int counter;<br />
Match m;<br />
CaptureCollection cc;<br />
GroupCollection gc;<br />
<br />
Regex r = new Regex("(Abc)+");<br />
m = r.Match("XYZAbcAbcAbcXYZ");<br />
gc = m.Groups;<br />
MessageBox.Show(m.Groups[1].Value + " " + m.Groups[0].Value);<br />
MessageBox.Show("Captured groups = " + gc.Count.ToString());<br />
<br />
for (int i = 0; i < gc.Count; i++)<br />
{<br />
cc = gc[i].Captures;<br />
counter = cc.Count;<br />
MessageBox.Show("Captures count = " + counter.ToString());<br />
for (int ii = 0; ii < counter; ii++)<br />
{<br />
MessageBox.Show(cc[ii].Value + " Starts at character " +<br />
cc[ii].Index.ToString());<br />
}<br />
}
The original text to match was a little different and I modified it. Now I wonder why gc includes 2 groups; one is AbcAbcAbc and the other is Abc. Could please anyone explain this?
|
|
|
|
|
|
Hi,
I have created a nice effect using a Timer and changing form height in the tick event which its Interval is set to 1.
I each tick, the following code is executed:
this.Height += 2;
In my Form1_Load event I have:
this.Height = 0;
The form is flickering. I tried to set DoubleBuffered property to Yes but it didn't help.
How can I overcome this problem?
Your help would be greatly appreciated.
|
|
|
|
|
yeah and it must be flicker because you set interval to 1.
that work so rapidly and require lots of process in very little time
so increase the interval until you get the working one
Becoming Programmer...
|
|
|
|
|
Hi!
i want to add happy2.gif into Demo.resources and then use it when i click button like this:
public Form1()
{
InitializeComponent();
ResourceWriter rw = new ResourceWriter("Demo.resources");
rw.AddResource("img", new Bitmap("happy2.gif"));
rw.Generate();
rw.Close();
}
private void button1_Click(object sender, EventArgs e)
{
ResourceManager rm = new ResourceManager("Demo.resources", GetType().Assembly);
Bitmap b = (Bitmap)rm.GetObject("img");
pictureBox1.Image = (Image)b;
pictureBox1.Height = b.Height;
pictureBox1.Width = b.Width;
}
But it did not work. I also added file Demo.resources from debug folder (by add existing item...) . Here is error message:
"Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Demo.resources.resources" was correctly embedded or linked into assembly "Create_Resx" at compile time, or that all the satellite assemblies required are loadable and fully signed."
Best regard!
|
|
|
|
|
Make sure your resources are set so their build action is 'embedded resource'. Then find an online tutorial and work through it, this can be tricky to make work the first time.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks for replying!
|
|
|
|
|
Hello,
I want to know how to use the bar code scanner machine in my application is there any articles which speak about this topic?.
Thanks.
Dad
|
|
|
|
|
IT depends on your scanner. The hardware manufacturer needs to provide an SDK or a driver that gives you access to the hardware.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Barcode readers usually act like keyboards. You put the cursor in a textbox, read the barcode, and whatever the barcode contains (usually numbers but can also contain text), appears in your textbox as if it had been typed in the keyboard.
At least all the barcode readers I have used work that way.
|
|
|
|
|
Barcode scanners are generally 'keyboard wedge' these days, meaning they pretty much act like a keyboard.
The only time you'd probably need to write anything to read it would be if the scanner is serial port based. But that should be easy enough in .NET 2.0 with the SerialPort object in (I think) the System.IO namespace.
Generally, I'd really recommend using a keyboard wedge type scanner - if for PS/2 based keyboards, it will have a cable to create a junction for both the scanner and the keyboard to connect to the PS/2 port. If it's USB, it's even easier - it should simply work after being connected. The bonus with the USB/keyboard wedge ones is that you can test in places like notepad if it doesn't appear to be working property.
The only thing you may need to do is configure the scanner (from the user guide) by scanning a few barcodes if it doesn't behave exactly how your application is expecting input.
------------------------
Luke Lovegrove
------------------------
|
|
|
|
|
Basically I need to make a 5 x 5 triangular array which I did and it needs to simulate the cracker barrel peg game which I can't figure out, and I need to have it done by tomorrow
here's what I have so far:
using System;<br />
using System.Collections.Generic;<br />
using System.ComponentModel;<br />
using System.Data;<br />
using System.Drawing;<br />
using System.Text;<br />
using System.Windows.Forms;<br />
<br />
namespace Pegs<br />
{<br />
public partial class Form1 : Form<br />
{<br />
const int size = 5;<br />
Color[,] Brd;<br />
<br />
public Form1()<br />
{<br />
InitializeComponent();<br />
Brd = new Color[size, size];<br />
}<br />
private void PrintBrd(Color[,] B)<br />
{<br />
int i, j;<br />
Graphics Draw = CreateGraphics();<br />
SolidBrush PB = new SolidBrush(Color.White);<br />
Draw.Clear(Color.DarkGray);<br />
for (i = 0; i < B.GetLength(0); i++)<br />
<br />
for (j = 0; j < B.GetLength(1); j++)<br />
{<br />
<br />
if (j <= i)<br />
Draw.FillEllipse(PB, 225 + 60 * j + (30 * (size - 1 - i)), 100 + 60 * i, 50, 50);<br />
}<br />
Draw.Dispose();<br />
}<br />
<br />
private void startButton_Click(object sender, EventArgs e)<br />
{<br />
PrintBrd(Brd);<br />
}<br />
<br />
private void Form1_Click(object sender, EventArgs e)<br />
{<br />
<br />
}<br />
private bool IsIn(int x, int y, ref int i, ref int j)<br />
{<br />
bool found = false;<br />
for(i=0;i<Brd.GetLength(0);i++)<br />
{<br />
for (j = 0; j <= i; j++)<br />
{<br />
if (x >= 225 + 60 * j + (30 * (size - 1 - i)) && x <= 225 + 60 * j + (30 * (size - 1 - i))+ 50 &&<br />
y >= 100 + 60 * i && y <= (100 + 60 * i)+50)<br />
{<br />
found = true;<br />
<br />
break;<br />
}<br />
<br />
}<br />
if (found)<br />
break;
}<br />
<br />
return found;<br />
}<br />
<br />
private void Form1_MouseClick(object sender, MouseEventArgs e)<br />
{<br />
int i = 0, j = 0;<br />
if(IsIn(e.X,e.Y, ref i,ref j))<br />
{<br />
<br />
}<br />
PrintBrd(Brd);<br />
<br />
}<br />
<br />
}<br />
}
Thanks for any help
|
|
|
|
|
People will not answer this. You need to ask a specific question to get an answer.
I suggest you break your problem down until it becomes simple, and if your still stuck, ask a specific question on the problem.
If you think about the problem as a whole, you may not be able to manage or come up with solutions. So concentrate on one specific thing at a time.
My current favourite word is: Bauble!
-SK Genius
|
|
|
|
|
Well, no-one is going to do your homework for you, but here are some starters
randomo wrote: Graphics Draw = CreateGraphics();
Never, ever do this. Do all drawing in your paint event. Open your app. Open calculator. Drag the calculator over your window. The reason it doesn't redraw itself properly, is that you used CreateGraphics.
Rather than an array of colors, keep an array of bools, specifying if a hole has a peg in it or not. The color is a rendering detail, and can be worked out from the bool.
An array of bools is easier to use to work out if a peg is there, and where it can move.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
well i'm definitely not gonna get it done, no help[ from you guys I guess, thanks anyway
|
|
|
|
|
Hi,
I have a small problem with my solution/references.
I have 2 projects in the solution. I use a folder(in the solution) where are some cs files. I need in one cs file use System.Managemet.
I know that exist references folder in a project, but these file is in the solution. There isn't any references folder.
How can I do that? Is it possible to have any reference inside a cs file?
Thanks.
|
|
|
|
|
I don't understand your question. You don't need explicitly add a reference to your project to use the classes in the System.Management namespace. They're available by default.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
when i want to use System.Managemet, have to add reference. Without reference it doesn't work.
|
|
|
|
|
I'm not sure why have to explicitly add a reference to System.Management to use it. But if it works then there's no problem, right?
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
I am so stupid. I have been looking for asolution a couple of hours.
I just added reference into both projects and it works.
Thanks.
|
|
|
|
|
i know flash media server offers the functionality of multi-person video chat, live broadcasting,
does microsoft also has a server like that?
thanks
|
|
|
|
|
Hi,
I use "microsoft access" file (mdb) as a local database.
I have no problem reading the data from it and show it on the DataGrid. the problem is when i want to delete a row i get Exceptions like:
"An unhandled exception of type 'System.InvalidOperationException' occurred in system.data.dll
Additional information: Update requires a valid DeleteCommand when passed DataRow collection with deleted rows."
Well , this is my code. can someone tell me what im doing wrong ?
Thanx
----------------------------------------------------------------------
dsDB.Tables["Clients"].Rows[1].Delete();
ClientsAdapter.Update(dt);
----------------------------------------------------------------------
dsDb is my DataSet.
ClientsAdapter is my DataAdapter.
as i wrote above, i can see the data from the database on my datagrid so i assume that there is no problems with the object i use.
|
|
|
|
|
In order for your code to work you must set the ClientsAdapter.DeleteCommand property.
|
|
|
|