c#-4.0

Executing batch file with ProcessStartInfo

和自甴很熟 提交于 2020-01-05 04:58:10
问题 I am using ProcessStartInfo class to execute a batch file. But I am not so aware of using it properly. When I execute a batch file can we track is there any error or not. In my scenario, batch will start another process and it is successfully started it will be keep on executing. And if there is any error executing batch file it will exit. This is the code I am using. I have to track both successfull start and failure as well. internal bool ExecuteBatchFile(string fileName, int executionTime)

The '', Hexadecimal value 0x1F, is not a valid character. Line 1, Item 1

血红的双手。 提交于 2020-01-05 04:43:28
问题 I am getting xml data through an httpwebrequest. The following code was working fine. But something changed and suddenly started to give me an exception on Read() method with error : The '', Hexadecimal value 0x1F, is not a valid character. Line 1, Item 1. In web browser sURL gives me a valid xml. I dont know what changed. HttpWebRequest req = (HttpWebRequest)WebRequest.Create(sURL); req.Method = "GET"; WebResponse response = req.GetResponse(); StreamReader resStreamReader = new StreamReader

Which SDK should I use for KR403 Zebra Printer

牧云@^-^@ 提交于 2020-01-05 03:28:20
问题 I am writing a .Net WPF application using C# for a Windows 7 64 bit platform. My application needs to communicate with a Zebra KR403 printer connected through USB. My questions may be very basic, but I'm hoping this post will help others who are new to using this printer in .Net. 1. Which SDK should I be using? Is it as simple as adding a .dll to my project and using it? I have tried using the Windows CE SDK, but I get a BadImageFormatException when the ZSDK_API.dll tries to load ZebraUsb.dll

Which SDK should I use for KR403 Zebra Printer

元气小坏坏 提交于 2020-01-05 03:27:12
问题 I am writing a .Net WPF application using C# for a Windows 7 64 bit platform. My application needs to communicate with a Zebra KR403 printer connected through USB. My questions may be very basic, but I'm hoping this post will help others who are new to using this printer in .Net. 1. Which SDK should I be using? Is it as simple as adding a .dll to my project and using it? I have tried using the Windows CE SDK, but I get a BadImageFormatException when the ZSDK_API.dll tries to load ZebraUsb.dll

Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED)): ActiveX and C# Console Application

僤鯓⒐⒋嵵緔 提交于 2020-01-05 02:23:31
问题 So, I am playing around with ActiveX and C# and ways how both of them can work together. the thing is I have hit the wall right in the beginning with mentioned error. Steps I have followed: In VS2010 I selected MFC ActiveX Control project. Then I added a method "SHORT Multiply( SHORT a, SHORT b);" by clicking the Add method option in the menu that pops when you right click _DProjectname under ProjectnameLib in solution explorer. The code for the method is as follows: SHORT

Return an output parameter from SQL Server via a stored procedure and c#

对着背影说爱祢 提交于 2020-01-04 19:08:41
问题 I am having a devil of a time getting an output value from SQL Server. Here is my stored procedure: ALTER PROCEDURE [dbo].[Insert_UnknownCustomer_Quote_Document] -- Add the parameters for the stored procedure here @NewDocumentFileName nvarchar(100), @NewDocumentWordCount int, @NewQuoteAmount money, @NewQuoteNumber int OUTPUT = 0 AS DECLARE @Today datetime SELECT @Today = GETDATE() BEGIN TRANSACTION BEGIN TRY BEGIN -- SET NOCOUNT ON added to prevent extra result sets from interfering with

Return an output parameter from SQL Server via a stored procedure and c#

冷暖自知 提交于 2020-01-04 19:07:50
问题 I am having a devil of a time getting an output value from SQL Server. Here is my stored procedure: ALTER PROCEDURE [dbo].[Insert_UnknownCustomer_Quote_Document] -- Add the parameters for the stored procedure here @NewDocumentFileName nvarchar(100), @NewDocumentWordCount int, @NewQuoteAmount money, @NewQuoteNumber int OUTPUT = 0 AS DECLARE @Today datetime SELECT @Today = GETDATE() BEGIN TRANSACTION BEGIN TRY BEGIN -- SET NOCOUNT ON added to prevent extra result sets from interfering with

Return an output parameter from SQL Server via a stored procedure and c#

白昼怎懂夜的黑 提交于 2020-01-04 19:07:02
问题 I am having a devil of a time getting an output value from SQL Server. Here is my stored procedure: ALTER PROCEDURE [dbo].[Insert_UnknownCustomer_Quote_Document] -- Add the parameters for the stored procedure here @NewDocumentFileName nvarchar(100), @NewDocumentWordCount int, @NewQuoteAmount money, @NewQuoteNumber int OUTPUT = 0 AS DECLARE @Today datetime SELECT @Today = GETDATE() BEGIN TRANSACTION BEGIN TRY BEGIN -- SET NOCOUNT ON added to prevent extra result sets from interfering with

Client side event that fires after ASPxClientGridView.ApplyFilter performs its work

社会主义新天地 提交于 2020-01-04 14:02:23
问题 This link explains how to handle it on the server side via the ASPxGridView.AfterPerformCallback event: http://www.devexpress.com/Support/Center/p/Q274366.aspx How can I handle it on the client side? I am working on a custom server control and I have this client side function on my control: applyFilterToGridView: function () { this.theGridView.ApplyFilter(this.filterCondition); this.filterAppliedEvent(); } Because ApplyFilter does a callback, this.filterAppliedEvent() is not called at the

Real purpose of providing TaskScheduler option through ParallelOptions parameter in Parallel class APIs

坚强是说给别人听的谎言 提交于 2020-01-04 14:00:56
问题 I have a windows C# WinForms application. I'm confused by the way the default task scheduler is behaving for parallel class in task parallel library. When I call Parallel.For inside ParallelForEach method I was expecting the numbers to get printed in jumbled fashion in output window through Console.WriteLine statement inside "Method1" method. Since I'm not passing any ParallelOptions to configure the scheduler for Parallel class it should be using default task scheduler but numbers are