|
You can use transactions and roll back in case of errors.
Try googling[^] around
Regards,
Lev
|
|
|
|
|
1) Make a copy of the table that the stuff gets imported to. Ensure that this table is empty.
2) Import all your stuff to the secondary table
3) If there are no exceptions then delete everything in the original import-table, and copy all stuff from the secondary table to the import-table. If an exception did occur, the original import-table will still hold all data.
You could also use transactions to achieve a similar functionality. SQL Server caches all changes that way, in order to 'undo' them.
I don't know which of these options would serve you best. The transaction-approach would probably be faster to implement.
I are troll
|
|
|
|
|
Hi all
In windows forms we use "Application.StartupPath" to get the application folder does anyone know the equavalent for webpages,
I need to write a file using a filestream but i need the root folder for the web application on the server.
Regards
|
|
|
|
|
i think Server.MapPath is there.
rahul
|
|
|
|
|
Rahul Thank you very much, it worked fine.
Regards
|
|
|
|
|
[DllImport("kernel32.dll")]
private static extern bool ReadFile(
int hFile, // handle to file
byte[] lpBuffer, // data buffer
int nNumberOfBytesToRead, // number of bytes to read
ref int lpNumberOfBytesRead, // number of bytes read
IntPtr lpOverlapped // overlapped buffer
);
Anyone know what is this? How do i know what ReadFile do?
Thanks
|
|
|
|
|
|
Nope. Noone. Even documentation ignore it [^], [^] (and the function's name, 'ReadFile ', is so obscure!).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: the function's name, 'ReadFile', is so obscure
it can mean many things, such as lets go and read some data from a serial port...
|
|
|
|
|
You know, the serial port is a file.
cpallinux.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
what the differences here: number of bytes to read and number of bytes read?
|
|
|
|
|
I would think that one refers to the number of bytes read and the other refers to the number of bytes to read.
...are you kidding?
I read 14 threads today, now I only have 6 left to read....
do you see the difference?
|
|
|
|
|
Hi,
How do check, is user logged in Windows (xp/vista) with smartcard or password?
--
regards
Alkeemik
|
|
|
|
|
Dear All, I have developed different applications including client/server, distributed desktop and web based using c#.
for the first time i am entering a new stage called finger print using c#, i really dont know where to start and where to finish. i am looking for any reference for book, website and other resources.
Your cooperation is fully appreciated.
|
|
|
|
|
Well, Google is always a good start. I got about 115,000 hits for "fingerprint c#"
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
for sure, there is a lot of rerference which google refer too. I will appreciate to start from the big pciture, the correct path.
Not those paths which takes too long to go through that, and finally with no destination.
Abdul Rahaman Hamidy
Database Developer
Kabul, Afghanistan
|
|
|
|
|
That is called research. It's an inevitable part of development
I are troll
|
|
|
|
|
Eddy Vluggen wrote: That is called research. It's an inevitable part of development
Sadly, a fact not recognised by many posters
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
People here are really stingy to reduce your research work. Maybe we need to get used to it.
I Love KongFu~
|
|
|
|
|
Please help me out.
I have an image and want to make it transparent. I didn't know how I will do this any idea will be helpful for me.
Thanks in advance.
|
|
|
|
|
First create a buffer image of the same size and resolution as the source image. Then draw the source image on the buffer, specifying the transparent color using the ImageAttributes.
Something like this:
Image image = Image.FromFile(@"c:\logo.png");
Bitmap buffer = new Bitmap(image.Width, image.Height);
buffer.SetResolution(image.HorizontalResolution,image.VerticalResolution);
Rectangle destRect = new Rectangle(0, 0, image.Width, image.Height);
ImageAttributes attributes = new ImageAttributes();
attributes.SetColorKey(Color.Red, Color.Red);
using (Graphics gr = Graphics.FromImage(buffer)) {
gr.DrawImage(image, destRect, 0, 0, image.Width,
image.Height, GraphicsUnit.Pixel, attributes);
}
buffer.Save(@"c:\logo2.png");
Regards,
Lev
|
|
|
|
|
Thanks for your reply.
This example very helpful but I want to make transparent whole image not just one or two colors.
I hope you can give me a good idea.
Regards
|
|
|
|
|
Naveed khan nido wrote: I want to make transparent whole image
What do you mean? if you want the whole image to be transparent, just create a new image object and save it right away.
That's not one or two colors, the SetColorKey accepts two color objects to specify the range of colors to make transparent.
Regards,
Lev
|
|
|
|
|
Yes I want to transparent whole Image.
What do you mean to create an object of image and save it. But I am going to transparent the whole image.
the example you given is just removing the desire color.
I create an black image and give black color parameter in you example it remove the black color but not showing the other side control.
If you can give me hit to properly transplant a single color then I will create a loop for all color.
Regards
|
|
|
|
|
Well, let me say again. If you want to make the whole image transparent, this is equal to creating an empty image of the same size and resolution and saving it, i.e. dropping the content of the image.
You could have modified the code I've sent pretty easy, but anyway, here it is:
Image img = Image.FromFile(@"c:\logo.png");
Bitmap buffer = new Bitmap(img.Width, img.Height);
buffer.SetResolution(img.HorizontalResolution, img.VerticalResolution);
buffer.Save(@"c:\logo2.png");
This will give you the same source image, BUT without the content (I actually wonder what is this for )
Regards,
Lev
|
|
|
|