|
|
Did you manually type in every column name?
What is the deal with schools these days? Do they just tell you to use a database for something, without teaching you anything at all about how to use a database, or how to design your tables, etc.?
Matt Gerrans
|
|
|
|
|
No I added them by a loop.
Regarding teaching ... this is our way to learn do projects and projects projects projects projects projects projects .
|
|
|
|
|
Hi there,
Assume a database with some tables made in Access 2000.
I can connect to it via oledbadapter (from C#) read rows, add rows etc.
Then I use ADOX to add a new table. The columns are created but no rows added.
The new table seems to be OK in Access 2000.
In Access I can add/delet rows.
BUT! When I try to add a new row via the oledbadapter (from C#) it fails.
Upon
MyoledbAdapter.InsertCommand.ExecuteNonQuery();
I get the error message “Syntax error in command”.
Well, there is no syntax error. The very same code inserts a new row into the other tables that were created in Access without any problem. (and of course I checked and double and triple checked it)
Of course I am missing something. But what? Is the table created with ADOX different? On what way?
I tried to find if there is a difference but it seems to be hopeless.
Pls. direct me to the source if you know where it is.
Many thanks,
Akos
|
|
|
|
|
In my current project i have two forms say FormA and FormB in which each form performs some specific task, how can i shift between the forms at a time.
As I said that I want to shift between the forms. It means that I have a function with two parameters if first parameter is null and second parameter is having some value it should call FormB. And Vice versa
i.e.
abc( Null, 10) here the first parameter is null and the second is value 10. Then it should call FormB similarly
abc (10, Null) here the first parameter value is 10 and the second is Null. Then it should call FormA.
How can i do it.
|
|
|
|
|
What do you mean - show one at a time ? You can have a main window that spawns form1, and when form1 closes, spawns form2. Or you can have Form1 the main window, and a next button that hides form1 and shows form2. It's hard to say, without knowing more specifics.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
using System;<br />
using System.Drawing;<br />
using System.Windows.Forms;<br />
using Microsoft.DirectX;<br />
using Microsoft.DirectX.Direct3D;<br />
<br />
<br />
namespace XSkate<br />
{<br />
public partial class MainForm : Form<br />
{<br />
Device device = null;
<br />
public MainForm()<br />
{<br />
InitializeComponent();<br />
}<br />
<br />
public bool InitializeGraphics()<br />
{<br />
try<br />
{<br />
PresentParameters presentParams = new PresentParameters();<br />
presentParams.Windowed = true;<br />
presentParams.SwapEffect = SwapEffect.Discard;<br />
device = new Device(0, DeviceType.Hardware, this, CreateFlags.HardwareVertexProcessing, presentParams);<br />
return true;<br />
}<br />
catch (DirectXException)<br />
{<br />
DisplayError("Could not initialize Direct3D, now exiting.", true);<br />
return false;<br />
}<br />
}<br />
<br />
private void Render()<br />
{<br />
if (device == null)<br />
{<br />
return;<br />
}<br />
<br />
device.Clear(ClearFlags.Target, System.Drawing.Color.Blue, 1.0f, 0);<br />
device.BeginScene();<br />
<br />
<br />
device.EndScene();<br />
device.Present();<br />
}<br />
<br />
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)<br />
{<br />
this.Render();<br />
}<br />
<br />
protected override void OnKeyPress(System.Windows.Forms.KeyPressEventArgs e)<br />
{<br />
if ((int)(byte)e.KeyChar == (int)System.Windows.Forms.Keys.Escape)<br />
{<br />
this.Close();<br />
}<br />
}<br />
<br />
static void Main()<br />
{<br />
using (MainForm frm = new MainForm())<br />
{<br />
if (!frm.InitializeGraphics())<br />
{<br />
return;<br />
}<br />
<br />
frm.Show();<br />
<br />
while (frm.Created)<br />
{<br />
frm.Render();<br />
Application.DoEvents();<br />
}<br />
}<br />
}<br />
<br />
private void DisplayError(string Message, bool Fatal)<br />
{<br />
if (Fatal)<br />
{<br />
MessageBox.Show(Message, "Fatal Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);<br />
}<br />
else<br />
{<br />
MessageBox.Show(Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);<br />
}<br />
}<br />
}<br />
}
It works but I don't know why the console window pops up along with the form, I don't want it to but what am I doing wrong? I am using Visual C#.NET 2005 beta 2, plz help, this is all the code I have in the project, except for the form code which is probably unnecessary for this problem, again plz help. confused:
IM PROUD TO BE A GMAIL;
|
|
|
|
|
Is your project's Output Type specified as Console application?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
I thought of that, but he has a mainform, surely the wizard added that ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
i renamed the whole class to mainform.. using refactor of course
IM PROUD TO BE A GMAIL;
|
|
|
|
|
That was it, sry I'm new to .net and C#, in c++ you didn't have to do this :P, that was it thank you.
IM PROUD TO BE A GMAIL;
|
|
|
|
|
Does anyone know how to manipulate treeview nodes such as copy, cut, & paste features? Any suggestions is greatly appreciated. thanx
|
|
|
|
|
AFAIK, there are no direct ways to do them. You can always simulate them by moving/adding the nodes. Like
TreeNode tempNode;
void CutNode(TreeNode selectedNode)
{
tempNode = selectedNode;
tempNode.Parent.Nodes.Remove(tempNode);
}
void PasteNode(TreeNode parentNode)
{
parentNode.Nodes.Add(tempNode);
}
void CopyNode(TreeNode selectedNode)
{
tempNode = selectedNode;
}
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
thanx for the tips. It works except for copyNode. You can't simple assign the selectedNode to tempNode because this doesn't actually make a copy of the selectedNode. Instead:
void copyNode(treeNode selectedNode)
{
tempNode = selectedNode.clone();
}
|
|
|
|
|
I am having some problems implementing Microsoft's Passport for sign in.
I am in a pre-production environment and I'm able to successfully sign in using a PREP e-mail but when I query the passport manager object using the IsAuthenticated function it says false
anyone know why this may be happening?
I need to get the authenticated user's PUID and can't unless they are authenticated
Any help would be greatly appreciated
schoudhr@hotmail.com
|
|
|
|
|
I have the following code, however it paints a different color :S
Color blueColor = Color.FromArgb(41, 22, 111);
g.clear(blueColor);
It displays Ok on a display with a 32bit color depth, however when I change it to 16bit, it appears lighter than it should. I'm guessing this is because of the unused alpha value, or maybe it's doing something strange with the gamma - beats me?
Does anyone know how to fix this so it displays the correct value on a 16bit display??
Thanks!
|
|
|
|
|
It doesn't sound strange to me, since RGB is a 24 bit value, even if computers like powers of 2. If no color table is used, then the 24 bit value needs to be encoded as a 16 bit color which is 5 bits for each color (red, green blue), 1 bit unused.
I may be not completely right with that.
E.g. a 16 bit color can be converted to a 32 bit value with:
Color32 = ( (((Color16 >> 10) & 0x1F) * 0xFF / 0x1F) |<br />
((((Color16 >> 5) & 0x1F) * 0xFF / 0x1F) << 8) |<br />
((( Color16 & 0x1F) * 0xFF / 0x1F) << 16));
Looks weird. A 16 bit color may look like tihs.
<br />
7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 <- Bits<br />
U R R R R R G G G G G B B B B B <- Color<br />
U = Unused<br />
R = Red<br />
...<br />
|
|
|
|
|
thanks for the explaination - i kinda get what you mean. One thing i don't understand, however, is the color16 and how to get the final value into a "Color" obj??
cheers!
|
|
|
|
|
IIRC rather than wasting a bit the green channel has 6 bits instead of 5 like the red/blue. I've no idea what makes green special.
|
|
|
|
|
yepp you are correct about the extra green bit..
because the human eye is more sensitive to see variations of green (i guess since our tree climbing/plains crawling days)
//Roger
|
|
|
|
|
The human eye is more sensitive to differences in green.
|
|
|
|
|
Hi there.
In order to create a class for a chat application - like readonly textbox that inherits the System.Windows.Forms.RichTextBox, I am trying to use a predefined color table (IRC-like textbox) in the RTF code.
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Fixedsys;}}<br />
{\colortbl ;\red0\green0\blue0;\red255\green255\blue255;\red0\green0\blue139;\red0\green100\blue0;\red255\green0\blue0;\red128\green0\blue0;\red128\green0\blue128;\red255\green165\blue0;\red255\green255\blue0;\red144\green238\blue144;\red95\green158\blue160;\red0\green255\blue255;\red0\green0\blue255;\red255\green192\blue203;\red169\green169\blue169;}<br />
"\viewkind4\uc\pard\f1\highlight1\cf2 This line uses the first color as foreground- and the second color as background-color on this line\par<br />
\highlight0\cf0 This line uses default colors.}
After I set the new RichText (control.RTF = variable), the RichTextBox automatically reformats the raw rich text I manipulated just a few ticks ago. It removes all not yet used colors from the colortable and even reorders it.
Is there a way to override/avoid automatic reformatting of the raw richtext (control.RTF)? I don't want to use the techinque where the last added text is selected, some forecolor applied, via API some background color applied, ...
Daniel
|
|
|
|
|
I've got a UserControl that responds to the MouseEnter and MouseLeave problems, making a highlight effect as the mouse passes over, however the controls within my control fire the MouseLeave event when the mouse moves from my control into the child control. Is there any way to make these controls "invisible" to mouse events?
Thanks in advance,
Peter
|
|
|
|
|
You could override the WndProc() method of the control to ignore the message.
|
|
|
|
|
Hmmm, how would that work? I don't want to completely ignore the MouseLeave event of the control, I just want to ignore the MouseEnter event of the child controls, wouldn't the MouseLeave event of the user control still get fired?
|
|
|
|