|
Hi all,
I have problem when merging existing DataTable into new dataset.
DataSet ds = new DataSet();
while ( done )
{
// fill myCustomDataSet.MyTable with data
ds.Merge( myCustomDataSet.MyTable, bPreserveChanges,
MissingSchemaAction.Add );
ds.AcceptChanges(); // tried with and without this line
}
In the loop I am filling my datatable and then I need to add all
content to new dataset.
I tried all combinations for bPreserveChanges, MissingSchemaAction but
can not accumulate rows in new dataset. If bPreserveChanges = true I
have only rows which were added during first call to Merger. If
bPreserveChanges = false I have rows from the last call to Merge.
Tried also to have myCustomDataSet.MyTable with or without primary
key. No difference.
I would really appreciate any suggestions
Thank you , Roman
|
|
|
|
|
Have you tried ds.Tables.Add(myCustomDataSet.MyTable.Clone())?
|
|
|
|
|
Thank you for response, but this definetly won't work, it will throw exception during second call to Add()
|
|
|
|
|
Hello,
Is there a way of calling ButtonCancel_ClickEvent, when the user clicks the X?
Or the only way is to place a call within the dispose method?
Thank you.
|
|
|
|
|
You can do this by responding to the forms OnClosing event.
|
|
|
|
|
I have a function "Execute(object a, object b)". If I call it directly, like Execute(Type.Missing, Type.Missing), everything works fine.
However, if I try to use MethodInfo.Invoke() to call it with the same two Type.Missing in the parameter list, I will get an exception saying that
This function doesn’t have any default parameters.
Do I forget to do sth?
PS: I read about the ParamterModifier class on MSDN, it mentions an attribute called pdHasDefault. Is that the solution to my problem? How should I use it?
Thank you very much
Brandon
|
|
|
|
|
Instead of using Type.Missing , I think that you need to use null .
|
|
|
|
|
I have created an n-tier application.
The client side (win forms) calls the business layer. Business layer calls the webservice and the webservice calls the data layer.
The datalayer gets the data using typed datasets.
In the datalayer I have created a .xsd file
In this layer I can use this typed dataset to work with the dataset. For example refer to the column of the table using the typed dataset.
The problem is that How can i be able to refer to the table columns on the client side using the typed dataset?
Thanks
|
|
|
|
|
Does anybody have a real experience with some commercial protection suite, as I need to implement it for the organization I work for? Dotfuscator I am not interested in, as we already use it and we will sure apply it before running any other protection scheme.
We are specifically interested in protection of the assemblies themselves and a copy protection, so that the code could only run on a specific machines.
Thanks.
|
|
|
|
|
mirano wrote: protection of the assemblies themselves
What exactly do you mean by this?
mirano wrote: copy protection, so that the code could only run on a specific machines
Have a look at http://www.xheo.com[^].
|
|
|
|
|
Depending on how much control you wish to have versus how much code you wish to write, you can take a client server approach where each station effectively checks out a license in order to get access to the resources. This is how the commercial product FlexLM works. From a software only point of view you can write the client stub and server code pretty easy but all of your apps would have to bind to the client stub in in order to request a license. If you wish to buy a solution then you can get information about FlexLM from Macrovision's website.
The chief selling point of FlexLM is a very good encryption scheme so that makes it hard for the average crook to steal unliscened usage.
As I said, you can definitely write your own implementation of such a scheme but you will need to ensure your own encryption scheme is up to the task. This might be a viable path if there are extenuating requirements you must factor in.
Good Luck
Mike Luster
|
|
|
|
|
I need to create a panel and button with smooth edges.
I would really appreciate if any one have any ideas or sample code.
Thanks,
Mahank
|
|
|
|
|
Have you tried searching CodeProject? Some of the Aquabuttons[^] here are really smooth
|
|
|
|
|
Robert,
Thanks for the link. I will definitely look into it.
Madhavi
|
|
|
|
|
I have been scouring Google for hours on this and can't find anything useful.
I have been wonmdering if there is a way to assign a transparent color (like Color.Transparent) for web graphics, basically a nice little class that would return a true transparent color, rather than having to run the entire image through a class to set a particular color transparent.
Or, barring that, a nice clean chunk of C# code that can be used to set the transparency to a particular color. 98% of what I have seen has so much garbage code in it it is hard to discern where the actual transparency code resides.
I would usually sit and hammer the hell out of messier code that I have managed to find, but I dont really have time to sit and play with it (which is a real shame. I love playing with image code)
Any ideas?
______________________
Mr Griffin, eleventy billion is not a number...
|
|
|
|
|
In what way should this be specific for web graphics?
Color.Transparent is a transparent color, why can't you use that?
---
b { font-weight: normal; }
|
|
|
|
|
When creating a Dynamic web image, for some reason, the browser does not actually render Color.Transparent as transparent. it usually seems to set it to black, which can be a problem.
I think it is because it handles the images by default as Bitmaps, rather than a gif (even though that has been specified) and the bitmap format doesnt support transparency (at least in .net)
______________________
Mr Griffin, eleventy billion is not a number...
|
|
|
|
|
Are you really sure that it handles the image as bitmap? Bitmap images are windows specific and uncompressed, so they are very impractical for web purposes.
---
b { font-weight: normal; }
|
|
|
|
|
here is an example of the code for a pretty simple image:
Response.ContentType = "image/gif";<br />
<br />
Bitmap bm = new Bitmap(300,300);<br />
Graphics gp = Graphics.FromImage(bm);<br />
<br />
Rectangle re = new Rectangle(0,0,300,300);<br />
SolidBrush br = new SolidBrush(Color.FromArgb(255,0,0,0));<br />
<br />
gp.FillRectangle(br,re);<br />
<br />
<br />
<br />
SolidBrush br2 = new SolidBrush(Color.Tomato);<br />
gp.FillEllipse(br2,75,75,150,150);<br />
<br />
gp.SmoothingMode = SmoothingMode.HighQuality;<br />
bm.MakeTransparent(Color.FromArgb(255,0,0,0));<br />
bm.Save(Response.OutputStream, ImageFormat.Gif);<br />
gp.Dispose();<br />
bm.Dispose();
this sits in the Page_Load of an aspx page. Notice that the object that is created and output is fundamentally a bitmap (which isnt actually windows specific), but is then output in gif format.
Color.Transparent works just fine for windows forms (win32 apps), but not so great for web graphics.
I have played with some classes others have created for making transparent gifs, but so far they are either terribly messy or hit-or-miss.
______________________
Mr Griffin, eleventy billion is not a number...
|
|
|
|
|
Have a look at this[^].
---
b { font-weight: normal; }
|
|
|
|
|
Awesome. I just modified it a little to work with my code, and it did. Thank you
how did you find that?
______________________
Mr Griffin, eleventy billion is not a number...
|
|
|
|
|
Heyas all,
I have project that has a mainform and on it is a read-only textbox control. I have another source file that hold a class I made myself. I'm trying to access the textbox control that is on the mainform from my class file, and I keep getting erros that it's inacceble. The code wizard automatically creates the control as private. I have a method in my class that simply does this:
void vWriteToTextbox(void)<br />
{<br />
}<br />
and like I said it's not working. How can I access the control from my file (which of course is in the same project)?
Thanks,
John
|
|
|
|
|
John L. DeVito wrote: How can I access the control from my file
Why would you want to do this?
You can either make the control varialbe "textbox1" public , or create a get-function (or property) to return the textbox variable like this:
public TextBox box { get { return textbox1; } }
You also need to have a reference to your main form, you can't just do MainForm.something unless something is declared static
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Okay, the easy way to fix this is select the TextBox in the form designer and change the value of the Design >> Modifiers property to public .
While that's the easy way, it breaks the encapsulation principle of OOD. May I suggest creating a property in your main form that exposes the value of the TextBox ?
For example, in your main form's class declaration, provide the following declaration.
public string MyInterestingTextBoxValue
{
set
{
this.textBox1.Text = value;
}
} Then, you can change your method above to
private void vWriteToTextbox()
{
MainForm.MyInterestingTextBoxValue = "Hello";
}
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Thanks Curtis I like the idea of wrapping it in a property. I know I could have changed the access identifier but I really REALLY didn't want to do that. Appreciate the time, works great. Thanks again.
Thanks,
John
|
|
|
|