|
|
|
|
You can read my image processing articles, they all do it.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
|
Collin Jasnoch wrote: Stream tStream = new FileStream(imgPtr, FileAccess.Read);//Can I do this???
ImageTransfer.EnqueueImageStream(tStream);
Not sure if you can do this. But, the rest looks right.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Image handle != File handle. That's why the filestream constructor fails.
Out of curiosity though, couldn't you just convert tempImage to a Bitmap, then call GetHbitmap?
|
|
|
|
|
Hi
how can i connect Oracle to my C# program ?
thank's
|
|
|
|
|
|
I can successfully build a list of processes and threads; but I'd like to be able to identify which user is running a process.
Does anyone have any insight into how to do this?
Thanks,
Matt Brown
|
|
|
|
|
|
Thanks for the info.
I had come across other example using win32_process, but I felt like it should be easier than this = there should be a method in a .NET class in system.diagnostic that I should be able to use to query for the username of a process.
But, I guess, I could be wrong
Thanks!
Matt Brown
|
|
|
|
|
Hi all
I dont know whether I am asking stupid ques or not but Can anyone advice me about some Insert in windows application.
I have 500000 data to insert in a database.
What will be most efficient way to do it?
Should I use ADO.NET or LINQ or in a proceduse or View....
By your advice I will start my coding
I am a Beginer...
Thanks
|
|
|
|
|
|
Yes Im using SQL Server...
|
|
|
|
|
Then create a stored procedure in you database with the method which was linked to in my previous post.
Then convert you information into an XML format and call the stored procedure with the XML.
Simple...
hmmm pie
|
|
|
|
|
|
I type this same thing over and over in emails to my customers and i was wondering how to write a macro to paste
Please acknowledge receipt of this order by email to me.
into the body of email by hitting a button on the task bar called "Please Acknowledge"
i have visual studio 2008 and using outlook 2007
anyone have any ideas.
Thank you
-Ryan
|
|
|
|
|
|
I'm not a programmer by any measure so I'm turning to you all for help.
I'm creating an InfoPath form which is housing some C# code to run WMI queries when the form is entered. The user will then enter in a few bits of information about them self and submit the form to a SharePoint library to help keep track of our users inventory.
My question is can someone help me clean up this code before i get too far into it? I've been using the WMI Code Creator from Microsoft's Website to get the code samples and by brut force I've gotten them to start to pull the information i'm looking for, but the code seems a little ugly and messy for me. I'm sure there has to be a way to condense some of this code and make it easier to manage and i want to start to figure that out before i get too far, once I see how it's done I should be able to figure it out from there. My code sample just has the video card and the sound card query, but eventually i'll have RAM, Hard drive, CPU, etc.
Code Sample:
using Microsoft.Office.InfoPath;
using System;
using System.Xml;
using System.Xml.XPath;
using System.Management;
namespace Inventory_Rev1
{
public partial class FormCode
{
public void InternalStartup()
{
EventManager.FormEvents.Loading += new LoadingEventHandler(FormEvents_Loading);
}
public void FormEvents_Loading(object sender, LoadingEventArgs e)
{
ManagementObjectSearcher searcherRAM =
new ManagementObjectSearcher("root\\CIMV2",
"SELECT * FROM Win32_PhysicalMemory");
ManagementObjectSearcher searcherDisplay =
new ManagementObjectSearcher("root\\CIMV2",
"SELECT * FROM Win32_VideoController");
ManagementObjectSearcher searcherAudio =
new ManagementObjectSearcher("root\\CIMV2",
"SELECT * FROM Win32_SoundDevice");
ManagementObjectSearcher searcherNIC =
new ManagementObjectSearcher("root\\CIMV2",
"SELECT * FROM Win32_NetworkAdapter");
foreach (ManagementObject queryObj in searcherAudio.Get())
{
string audioController = queryObj["Name"].ToString();
XPathNavigator xnMyForm = this.CreateNavigator();
XmlNamespaceManager ns = this.NamespaceManager;
xnMyForm.SelectSingleNode("/my:myFields/my:SoundCard", ns).SetValue(audioController);
}
foreach (ManagementObject queryObj in searcherDisplay.Get())
{
string displayAdapter = queryObj["Name"].ToString();
XPathNavigator xnMyForm = this.CreateNavigator();
XmlNamespaceManager ns = this.NamespaceManager;
xnMyForm.SelectSingleNode("/my:myFields/my:VideoAdapter", ns).SetValue(displayAdapter);
}
}
}
}
|
|
|
|
|
Is the subject line too long? Probably.
I'm experiencing an issue with my dataset that seems to be telling me that the values for a foreign key in my child table does not exist within the parent table. As far as I can see, the value does exist. This happens when I try to fill a datagridview using a tableadapter.
If the program throws the exception as normal I get the usual "Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints."
If I use a try/catch around the query it fills the datagridview but gives me a red warning sign that reads "ForeignKeyConstraint [ForeignKey] requires the child key values (value) to exist in the parent table."
Has anyone come across this particular issue? Where can I usually find the properties for foreign key contraints?
Any help would be hugely appreciated!
(I'm using the generic Fill query created for tables in sqlserver.)
|
|
|
|
|
Fill the reference table first and then fill the main table. Your error means that the referenfed DataTable does not have data that the maintable is refering to.
Post your code and ill see if i can assist you.
|
|
|
|
|
I came across this error to when I thought the parent value did exist. For me the solution was that I had to make sure that the ParentColumns and ChildColumns for the constraint listed the columns in the same order.
|
|
|
|
|
private void dataGridView1_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
{
if ((e.ColumnIndex == 3) && (e.RowIndex >= 0))
{
Rectangle textRange = new Rectangle(e.ClipBounds.X + 20, e.ClipBounds.Y, e.ClipBounds.Width - 20, e.ClipBounds.Height);
e.PaintBackground(e.ClipBounds, selected);
e.PaintContent(textRange);
e.Handled = true;
}
}
I'm trying to ofset the location of a text string in a winform DataGridView cell, but while the clipbounds parameter of of PaintContent appears like it should let my specify where to paint at, the text is always painted in the default location regardless of what I pass in. Am I doing something wrong with how I'm calling PaintContent , or is it not designed to do what I want? I can use e.Graphics.Drawstring if I have to, but would much prefer to let MS handle all the edge cases for me if possible.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
AFAIK PaintContent acts exactly like Invalidate(aRectangle) . That is, it repaints the rectangular area you pass.
Someone else may know how to do this, but all examples I have ever seen use either DrawString or a TextRenderer .
Sorry not to be of more help.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|