|
Gosh - I'm blushing....
If there is more than one user on the DB and so you can't know for sure that all the records in the DB have been read, then collect the Ids of the records you have read as you read them to build an SQL string like update myTable set Exported = 'Y' where ID in .... where .... is your list of Ids.
If this is a single user database then just do an update on all records - update myTable set Exported = 'Y'. And I assume you look for 'N' when you do the read, so you only export new records ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks Christian. I have posted the same question a few times and have been advised to go in and do this in the DB whereas I want to do this when I run the export. Why write code if I have to go and do something manually?
I plan on runnign the export after hours when nobody is using the system. So, basicaly what you saying is, After the export just do an update of all records annd set them to Y?
When doing the export, how do I only look for records that have the value N. DO I have to set this in the export routine?
Thanks again.
|
|
|
|
|
Yes, if you're the only one using it, you could even do a proc that says
select * from tbl where exported='N'
update tbl set exported = 'Y'
Although, I reckon it's safer to do the update AFTER you're sure you've got the data and used it
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Kwagga wrote: I think you may be the only one that will be able to answer me or help me.
Christian sure is a smart guy - no doubt about it. However, directing this at him and sticking your head that far up his arse kinda puts other people off of trying to help you.
Ill tell you this much - the right way to do this is to
1) Select only those rows that have Exported = 'N' (As CG said)
2) Export those records received from the query
3) Update only those records exported sucessfully with Exported = 'Y'
If you do step 3) before step 2) You should consider doing this within a transaction so that if any part of the export operation fails (and believe me it will at some point) the unexported records get set back to Exported = 'N'.
|
|
|
|
|
But, even if he does 1 and 3 in a transaction, the transaction will end before he starts 2. That's why I was also advocating the order you're suggesting.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Totally, Ive done it both ways:
Select/Export/Update (No xact needed)
Xact Begin/Select+Update/Export/Xact commit (xact necessary to maintain integrity)
I think I favour 1, cant remeember why I ever did 2.
|
|
|
|
|
Hello,
I’m developing non commercial software using Visual C#. In the software, by clicking a button I can open under DOS program, which is named “Linear”, using code bellow
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo.FileName = "start";
proc.StartInfo.Arguments = "Linear";
proc.Start();
proc.WaitForExit();
The Linear lives in the same folder with my software so I don’t use full path for calling Linear.
When I debug my software, the under DOS program could be called and no problem at all. Then, I made setup application of my software, install it in my computer and the software work smoothly.
The problem is when I install my software on other computers and I click the button to open the under DOS program, suddenly warning box occurs with message bellow
///
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.ComponentModel.Win32Exception: The system cannot find the file specified
at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at Fondamen.Run.button3_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.832 (QFE.050727-8300)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
Fondamen
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Program%20Files/Institute%20Technology%20of%20Bandung/Setup%20Fondamen/Fondamen.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.832 (QFE.050727-8300)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.832 (QFE.050727-8300)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.832 (QFE.050727-8300)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.832 (QFE.050727-8300)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.832 (QFE.050727-8300)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Accessibility
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitdebugging="true">
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
///
I don’t know wheter it is caused by different environment variables or not. Even, if it is caused by different environment variables, I don’t know how to cope this. Please give me solution. Thank you before.
Andhika Sahadewa
|
|
|
|
|
Application.ExecutablePath is the way to build a full path to your local folder.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thank you. Now the problem is solved
|
|
|
|
|
hi everyone
plz help me How can i Compare two word files bit to bit, in C#
jayee
|
|
|
|
|
You can open them as binary files, but the comparison won't tell you how the word docs differ in content, only their representation on the HDD
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
Life was great - I loved C++.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Life was good, with C++, with bit more control as well.
By the way, it was a great gesture shown by thanking all, and its rare too.
Regards,
Adeel
Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.
|
|
|
|
|
C++ and MFC. works great, but I don't like managed C++, this looks awful. One of the lovely things of C+= are the wizard templates, which are much better than for C#. I switched to C# mainly because it supports .NET, which is good and bad. Good because there are so many functions, bad because it is very complicated and takes a lot of time to learn.
C# is a lovely language in may respects, but I don't like the way they treat arrays and strings. And I miss the convenience of the preprocessor.
Rudolf Heijink
|
|
|
|
|
There was no life whatsoever before C#. It was stone age.
PS: Don't forget to ask this same question again in ten years time, with whatever
the most recent big language will be called at that time.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Hey,
I totally agree with you Luc, in ten years programming will be so easy that i will become a guru of it!!!
With all due respect to everyone, before C# i believe things were a little harder to do, programmingly speaking...
I once tried to learn C++ on my own and probably because of the lack of info i had back then it was really hard to do, so much that i could not even create my own classes!!!
But life is great now thanks to both !!!!
Luis E Tineo S
|
|
|
|
|
hello every one... plzz.. help me .. actually i want 2 send emails automatically at a particular time how can i do this ..plzz..help me...
thanks 2 all..
|
|
|
|
|
Use a service (windows or web) with a timer. When the timer reaches the particular time needed send the emails by using the System.Net.Mail.MailMessage class.
I am fighting against the Universe...
Reference-Rick Cook
|
|
|
|
|
but how can i do ..plz..send me code brother......if u have or give me any sugession..
thanks 2 all..
|
|
|
|
|
I have used this approach in a project of mine . I created a windows service and by default this will give you 2 event handlers : OnStart & OnStop. In the OnStart you could do something like this :
protected override void OnStart(string[] args)
{
Alarm.Elapsed += new ElapsedEventHandler(OnElapsedTime);
Alarm.Interval = SETINTERVAL;
Alarm.Enabled = true;
}
The "alarm" object is an instance of System.Timers.Timer class. In the OnElapsedTime event you can check to see if the time has come to send the mails and call the appropiate method. As for the MailMessage class and how to use it I suggest using Google for the answer.
I am fighting against the Universe...
Reference-Rick Cook
|
|
|
|
|
plzz tell me how can i create windows service.. even i m doing on webapplication ..is it workin in web application..wht u given code 4 me..plzz tell me..brother..
thanks 2 all..
|
|
|
|
|
use system.net.mail namespace
MailAddress SendFrom = new MailAddress(txtFromAddr.Text);
SmtpClient objSmtpClient = new SmtpClient();
objSmtpClient.Host = "mail.techgene.net";
objSmtpClient.Credentials = new System.Net.NetworkCredential("uname", "pwd");
MailAddress SendTo = new MailAddress(_mailId);
MailMessage objMailMessage = new MailMessage(SendFrom, SendTo);
objMailMessage.Subject = Convert.ToString(txtSubject.Text);
objMailMessage.Body = Convert.ToString(webBrowser1.DocumentText);
objMailMessage.IsBodyHtml = true;
objSmtpClient.Send(objMailMessage);
G. Satish
|
|
|
|
|
I want to select the file and i want to get the path of the file like(browsefile dialog,savefiledialog,openfiledialog)i can`t use the above dialogs because i just
want to select the file and getting path.
(ex:openfiledialog ->browser window we have option "open"->i don`t need this option
i want like "select" option (and i want to select the file not the folder)
how can i do this in c#.. help me
madhu
|
|
|
|
|
madhugurukul wrote: can`t use the above dialogs because i just
want to select the file and getting path.
Say what ? Why can't you use those ? They do exactly what you want, select the file and tell you the path.
Just use the SelectedFile property, or whatever it is. Just because there's an open method, doesn't mean you need to use it ( I never have )
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|