|
i want SQL statment to retrive last 3 records
Palestine
|
|
|
|
|
SELECT TOP 3 *
FROM Table
ORDER BY ID DESC
Should have posted in the SQL forum though...
Snorkie
|
|
|
|
|
|
I have written a web based C# app that communicates with another System (G1) by consuming a web service via a proxy. The other system is Launch version 2 (G2), which will migrate clients over several months, so 2 webservices will need to be consumed. Both services are similar, but not identical.
Based on a Version value in the database associated with the client I need to instantiate objects from the G1 proxy service or G2 proxy service. However, I would then like to process them using common code, but based on the Version Value, perform specific assignments.
The proxy has the 2 services defined as
CIServiceProxy.CIService.Service
CIServiceProxy.G2CIService.Service
The services are extensive with 30 methods and 100s of properties.
Any help on direction greatly appreciated. My 5 day project has just leapt into infinity!
cheers
G Field
|
|
|
|
|
|
well...if this is an assignment, I highly doubt that your instructor is just "throwing you to the wolves" so to speak. Have you searched google? The MSDN? I suggest you start there. You learn nothing if someone else does your work for you....now if after doing some research into what you're supposed to do, you have SPECIFIC questions about how to work through issues that come up, this is the place to come
"I need build Skynet. Plz send code"
|
|
|
|
|
*cough* xor *cough*
File Not Found
|
|
|
|
|
I have an application that needs to read data continuously from some equipment while allowing user input. The application uses two threads, one for reading and writing data to this 'equipment', while the other is the user interface thread. This arrangement generally works fine and the application communicates needed information between the two threads seamlessly.
Unfortunately, as happens so often, new requirements for the application have come into play. In the event of a failure in some process run on the equipment, the user needs to be notified AND prompted with a query.
Previously, any errors encountered during communication with the equipment were reported via audible and/or email messages detailing the nature of the problem, which was 'easy' enough to handle, but now the user will need to do something about the error. I don't want to interrupt the thread reading the equipment, so I think it makes sense to have the failure trigger an event that then pops up a MessageBox or other user interface form to allow the user to choose an appropriate course of action while allowing the data processing thread to continue.
Would anyone be able to make some suggestions regarding how to solve this problem? As it so happens, certain data from the failure event needs to be recorded, so I would think a DataTable event might do the trick, but am open to any helpful suggestions. Thanks.
|
|
|
|
|
I have been search for a way to do this, and I haven't been able to find anything for .NET 2.0 There are a few solutions for 1.0, but not for 2.0 =( Can anyone point me in the right direction here? Thanks =)
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
I thought of another way to do it. I can use process.start to start shutdown.exe, and pass the argument to restart the system That will work just fine.
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
(Code for what he is talking about)
this worked for me:
Process p = new Process();<br />
p.StartInfo.FileName = "shuwdown";<br />
p.StartInfo.Arguments = "-r -t 0";<br />
p.Start();
the best way is to add a static boolean and if you need to reboot set it to true then add the following as the last thing in your main() function:
if(bDoReboot)<br />
{<br />
Process p = new Process();<br />
p.StartInfo.FileName = "shuwdown";<br />
p.StartInfo.Arguments = "-r -t 0";<br />
p.Start();<br />
}
this has issues tho because they might be a limited user and not allowed to shutdown
|
|
|
|
|
Theres no reason code written to target the 1.x framework would fail to work in the 2.x framework!
|
|
|
|
|
|
Even that's not acceptable. What if the user isn't at the machine when the 30s countdown starts, or what if they're doing something in a different app that can't be saved immediately? Anything other than a "This application needs to reboot your system. Reboot now? Yes/No" dialog that honors the no choice is totally unacceptable. I've encountered a few that didn't in the past. For some odd reason I don't think any of them lasted more than 10 minutes on my harddrive.
--
You have to explain to them [VB coders] what you mean by "typed". their first response is likely to be something like, "Of course my code is typed. Do you think i magically project it onto the screen with the power of my mind?" --- John Simmons / outlaw programmer
|
|
|
|
|
Whoops, yeah. Present the MessageBox, and if Yes, then proceed to InitiateSystemShutdown.
|
|
|
|
|
|
Hi!
I have a listbox control. I want to change the color of each item based on some condition. But i don't know how change the color of an item of listbox control. Please, help me in this regard. Thanks!
|
|
|
|
|
There's no built-in way to do this. There is, however, a way to do this with the ListView control. ListViewItem.BackColor
|
|
|
|
|
Thanks!
I have coded it in the following way:
private void lstBoxSystemTypes_DrawItem(object sender, DrawItemEventArgs e)
{
ListBox listBox = (ListBox)sender;
string itemValue = listBox.Items[e.Index].ToString() ;
e.DrawBackground();
Brush brush = Brushes.Red;
e.Graphics.DrawString(itemValue, e.Font, brush, e.Bounds, StringFormat.GenericDefault);
e.DrawFocusRectangle();
}
But the itemValue (string variable at line 4) contains something like "System.Data.Data". I want the actual value to be painted.
Thanks once again
|
|
|
|
|
Hello! I made it possible in the following way:
private void lstBoxSystemTypes_DrawItem(object sender, DrawItemEventArgs e)
{
ListBox listBox = (ListBox)sender;
string itemValue = listBox.Items[e.Index].ToString() ;
System.Data.DataRowView dataRowView = (System.Data.DataRowView)listBox.Items[e.Index];
e.DrawBackground();
Brush brush = Brushes.Red;
if (bool.Parse(dataRowView["Approved"].ToString()))
brush = Brushes.Black;
e.Graphics.DrawString(dataRowView["Name"].ToString(), e.Font, brush, e.Bounds, StringFormat.GenericDefault);
e.DrawFocusRectangle();
}
But there is another problem: item's color doesn't change when it is selected.
|
|
|
|
|
How to Import Data from MS Excel to DataSet using C#. View them into DataGridView, populate into SQL Server 2000 and BindingData in controls
Learning forever
|
|
|
|
|
tuansara wrote: How to
Indeed! If only the internet had sites where people published documentation and instructional articles and blogs related to issues such as this. And then if only there existed some way to search the internet using key words to locate that type of information.
If only....
|
|
|
|
|
How to Import Data from MS Excel to SQL Server 2000????
Learning forever
|
|
|
|
|
You question is very general, so this will be a general answer: first, get the data out using something like Visual Studio Tools for Office (google it). Then use ADO.NET to insert that data into SQL.
|
|
|
|
|
I have an InfoPath file and want to create an xml file of it using C#.
The xml file should look exactly like the one that would be saved if I opened the form with InfoPath and saved it as xml.
Can that be done somehow with C#?
I've tried to rename the xsn file to cab, extract template.xml and sampledata.xml, but they are nothing like the xml file that is created from InfoPath.
|
|
|
|