|
I created a DataTable thru coding and store some rows/data in it.
After that I want to select "Distinct" data from this table.
Datatable dt;
dt.Select("DISTINCT column1");
its saying ="Missing operand after column1 operator"
I want to select DISTINCT rows from this dt table but its not working,
I am using vs2003.
|
|
|
|
|
The DataTable has no built in support for this, you'll basically have to roll your own.
Check out this article: Select DISTINCT on DataTable[^]
Your other option would of course be to just grab all the rows using DataTable.Select() then de-dupe the returned array.
|
|
|
|
|
I have a pixel array -
1-D byte array, with each 4 bytes representing B G R A componenets of a pixel.
I want to convert this to an image and render it on screen.
What Class should I be using to
1) Conver to image
2) Render image
|
|
|
|
|
Use this, for example:
Put picturebox on screen:
Bitmap bitmap = new Bitmap(10, 10);
bitmap.SetPixel(1, 1, Color.FromArgb(255, 255, 255));
bitmap.SetPixel(2, 2, Color.FromArgb(100, 200, 80));
pictureBox1.Image = bitmap;
|
|
|
|
|
That is a very inefficient method for large images.
A better method would be
BitmapSource bs = BitmapSource.Create(
(int)size.Width,
(int)size.Height,
96d,
96d,
PixelFormats.Bgra32,
null,
pixels,
stride);
Image image = new Image();
image.Source = bs;
canvas2.Children.Add(image);
|
|
|
|
|
I don't see any System.Windows.Media.Imaging.BitmapSource in .NET 2.0.
What kind of .NET are you using ?
|
|
|
|
|
That's WPF, "Supported in: 3.5, 3.0 SP1, 3.0"
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi, i have this main form(mdi). When i open a form, called "EditQty",
childEditQty.parent = this;
then within the editqty, i want to open 1 more form and i want to set the parent to the mainForm,
childSelectedQty = new FrmSelectedQty();
childSelectedQty.MdiParent = EBMS.FrmMain();
childSelectedQty.Show = true;
i cannot set childSelectedQty.MdiParent = EBMS.FrmMain(); to 'this' because this itself its a child form, how do i reference back to set the mdiparent to the main form
|
|
|
|
|
childEditQty.Parent references the frmMain so use that.
[edit] i.e. childSelectedQty.MdiParent = this.Parent;
or childSelectedQty.MdiParent = this.MdiParent; [/edit]
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
Hi there,
I am curious as to what "n products" are available? I know of nunit, ncover, and ndepend. I'm just curious.
Brendan
|
|
|
|
|
This isn't really a C# question is it? You should put this in the General forum or the Lounge.
|
|
|
|
|
Search for ALT.NET - All these products are from different places - there is no unified list of n-products. However, the products you mentioned are heavily used by the ALT.NET community.
|
|
|
|
|
This question is "n appropriate" here.
|
|
|
|
|
Hi, i got 2 list view on 1 form. the first list view shows the product name and the other listview show the supplier name.
the user have to first select a item from the product list view , then select another item from the supplier list view.
By now, both selected items should be highlighted.
When i press the ok button, i wan to know in product list box, what the user selected and in the supplier list box, what the user selected.
However when i select 1 item from product, then i select the other item from supplier, the product list view is being disselected
DataTable dt = new DataTable();
dt = pa.GetData();
foreach (DataRow rows in dt.Rows)
{
ListViewItem product = new ListViewItem();
product = listView1.Items.Add(Convert.ToString(rows["productID"]));
product.SubItems.Add(Convert.ToString(rows["name"]));
product.SubItems.Add(Convert.ToString(rows["modelNo"]));
}
DataTable dt1 = new DataTable();
dt1 = sa.GetData();
foreach (DataRow rows in dt1.Rows)
{
ListViewItem supplier = new ListViewItem();
supplier = listView2.Items.Add(Convert.ToString(rows["companyName"]));
supplier.SubItems.Add(Convert.ToString(rows["contactName"]));
}
|
|
|
|
|
Hi.
Try setting
ListView.HideSelection = false;
Kjetil
|
|
|
|
|
Can someone refer me to some good examples of c# coding related to electronics please? That is using c# coding combined with some electronic device for example some sort of switches.
|
|
|
|
|
How are your electronics connected to the computer?
Regards,
Rob Philpott.
|
|
|
|
|
Thats what one of the things that i want to learn. I want to learn more about the connection and communication between them.
|
|
|
|
|
Probably the easiest way to get things to light and up and detect switches etc is through USB HID. (Google it). Windows provides standard drivers for HID devices (like your mouse).
Regards,
Rob Philpott.
|
|
|
|
|
I saw a couple of nice articles here on CP. One was about controlling some LED's and the other was about an LCD display. I'll surely find them.
|
|
|
|
|
|
Hello everyone,
I have did quite a lot search but failed to fina how to using SSL (Https) to consume remote web services from client side and using ServerCertificateValidationCallback.
Does anyone have any documents or samples to make a reference?
thanks in advance,
George
|
|
|
|
|
What is the problem? Are you trying to access a HTTPS site without a valid certificate? If so, just return true from your RemoteCertificateValidationCallback (I assume you are using that class).
|
|
|
|
|
Thanks leppie,
My current issue is, I want to access a remote Web Services through https other than through http. In this case, I want to use server certificate, but not using the client certificate (one-directional authentication). And in my situation, simply accept all server certificate is fine, and I just need the traffic encryption feature of https.
But I can not find such samples both in my books and in the internet. So I come here for help. Do you have any documents or samples to make a reference?
regards,
George
|
|
|
|
|
Hi,
I am developing forums website...here I need to do code for rating an article in C#.anybody know plz reply me..
thanks
Raaj
|
|
|
|