sparkab's Q&A profile
Visual C# Extracting print jobs fromprint queue
Hi, Is it possible to extract a print job from a print queue using c# I have managed to pause/resume and extract details of the print jobs via calls to imported winspool.drv methods, but can't see a way to get the actual job itself. Cheers, Paul G Hi, Here is about the printing issue in C#: http://www.devarticles.com/c/a/C-Sharp/Printing-Using-C-sharp/ ...Show All
Windows Forms SetColumnValueAtRow passing currency manager, row number and button text in v1.0 not working in 2.0
Got my original code from http://msdn.microsoft.com/library/default.asp url=/library/en-us/dnwinforms/html/datagridcolumnstyle2.asp public class DataGridButtonColumn : DataGridColumnStyle { private void DataGrid_MouseUp( object sender, MouseEventArgs e ) { ... // check to see if the cursor is within the bounds of the button if ( cursorRect.IntersectsWith( buttonBounds ) ) { object ds = this.DataGridTableStyle.DataGrid.DataSource; string dataMember = this.DataGridTableStyle.DataGrid.DataMember; // retrieve the currency manager object from the form's binding context CurrencyManager cm = ( CurrencyManager ) this.DataGridTableStyle.DataGrid.BindingContext[ ds, dataMembe ...Show All
SQL Server SSIS Checkpoints
I have a package that uses ssis checkpoints. It works well. However, when I try to setup transactions for some task, the chekpoints aren't used. I read BOL and It states: "If a package is configured to use checkpoints, Integration Services captures the restart point in the checkpoint file. The type of container that fails and the implementation of features such as transactions affect the restart point that is recorded in the checkpoint file ." But, how checkpoints are affected by transactions what relation exists between this two components Hernan93 wrote: I have a package that uses ssis checkpoints. It works well. However, when I try to setup transactions for some task, the chek ...Show All
SQL Server Pauzing SQL Queue processing
Hello, I'm currently looking for a way to decently pauze the processing of messages by activation procedures. When I pauze the processing I want to be sure that the running activation procedures terminated. I thought I could do this using ALTER QUEUE WITH ACTIVATION (STATUS = OFF) and sys.dm_broker_activated_tasks. This is what I've tested: I set up one queue with an activation procedure attached to it that receives one message, then waits for one minute, then writes that message into a table. The queues max queue readers is set to 2. Now, I put 5 messages in the queue, 2 procs pop up in sys.dm_broker_activated_tasks. I run the alter queue statement shown above and check sys.dm_broker_activated_tasks again. It is empty so allegedly t ...Show All
SQL Server Error Starting Script Editor in SSIS
I am having a problem in the Business Intelligence Development Studio. When I add and try to edit a Script Task or a Script Component, I click on the Design Script button and get one of two errors. For the Script task I get an error that states: Cannot show the editor for this task. (Microsoft Visual Studio) For the Script component I get: Cannot show Visual Studio for Applications editor. (Microsoft Visual Studio) For some reason or another it just will not start Visual Studio for Applications. I have uninstalled an re-installed several times. I have also researched and discovered that there is a bug when C# tasks are include in the project. However, this is not the case. Please help! hi, Weird thing happen to SSIS ...Show All
Smart Device Development Read text file from Mobile Device
Hello I have a active sync connection to a pda emulator. Is it possible to read a text file from the device using a stream reader e.g StreamReader sr = new StreamReader(@"My Computer \My Documents\My Music\jl.txt"); string fileText = sr.ReadToEnd(); sr.Close(); The emulator allows you to map a storage card to a folder on the desktop, you can then open files in this folder using a local path e.g. \Storage Card\mytextfile.txt Peter ...Show All
Visual Studio 2008 (Pre-release) Is Join redundant in LINQ to SQL?
Join and GroupJoin have obvious performance advantages over nested selects & subqueries in compiled queries (e.g. LINQ to IEnumerable, LINQ to XML). But in LINQ to SQL, are the Join and GroupJoin methods completely redundant So far, every LINQ to SQL query I've written with join / join...into I've been able to express with multiple generators or subqueries -- and in most cases, as easily, or more easily. And the SQL that's produced in the end is usually either identical or equally efficient either way. Do Join and GroupJoin exist purely to enhance the performance of compiled local queries Also, can anyone come up with a LINQ to SQL join / join into... query that CANNOT easily be expressed otherwise Joe ...Show All
Visual Studio Tools for Office How to get VSTO running with Visual Studio 2005?
Hi, I have problem getting VSTO to work with VS 2005. I installed several times but i still dont see the "office" subtree when creating a new project. I installed in the following order. 1) Office 2003 Professional 2) Update Office 2003 to SP2 3) VS 2005 4) VSTO addon (vstor.exe) Then I also tried not updating to SP2 after browsing a few forums but it is still not working. Is there anyway to solve it Or is there an incompatibility with the version of software I am using Please help me, i have sleepless night because of this simple problem ( uninstalling and reinstalling take hours). Oh, that's really bad. Should I just stick to COM add-in I don't think my company would want to fork out another $5 ...Show All
.NET Development Custom UserNameTokenManager using .NET class
Hi, I have a VB6 ASP dll making a late bound call ("CreateObject") to a .NET DLL. This .NET class is used to call a WSE2.0 enabled web service. The .NET DLL returns a record set to the VB6 ASP dll. The .NET class can call the web method and it encrypts the request body using a Username/Password token with the password hashed. At the web service, a custom UsernameTokenManager overrides the AuthenticateToken and VerifyHashedPassword functions, normally handled by WSE. The method executes, and returns an encrypted response to the .NET class that made the request. Therein lies the problem. When the encrypted response is received, WSE throws: WSE562: The incoming username token contains a password hash. The built-in Use ...Show All
.NET Development email distribution list via System.Net.Mail
Hi, Is it possible to email a distribution list via System.Net.Mail.MailMessage I have passed a distribution list name to the "To" parameter of the MailMessage constructor e.g. ""Sales Department" but get an exception (Format exception) Message: " The specified string is not in the form required for an e-mail address." From this I am assuming distribution lists are not catered for. Is this correct Thanks for replies Durgaprasad thanks for the reply. To clarify, when you say correct I presume you mean that it is not possible to send a mail to a distribution list without having to individually add each email from the list to the "To" property. Is is no ...Show All
.NET Development CodeDom help needed to generate the following
Hi there, I would like to generate the following using CodeDom database db = DatabaseFactory.CreateDatabase(); DbCommand dbCommand = db.GetStoredProcCommand("EmployeesSelectAll"); return db.ExecuteDataSet(dbCommand); I am working on it by if somebody knows how to do it ,it would certainly save lots of time thanks in advance There is no method in the CodeDom to generate XML style documentation (AFAIK) but the CodeComment class has a property that indicates that a comment is documentation style commenting. The comment can be applied to types and type members using the Comments property of the object. You'll need to build the documentation by hand. You can easily create help ...Show All
.NET Development Add Web reference through coding
Hi, I have created one Windows service and Web service.I want to add the web reference in Windows service.Can i add the web reference through C# coding.Please Reply me. Thanks. justin(Navya) Hi jason, Thanks for ur reply.I am using C#.net.Here u told ,"You must add web reference"I am asking how can i add web reference. /////Dim service as New WS.webservice().//////This code is for calling a webservice after added it.I want the solution regarding add a web refernce through coding.Please reply me. Thanks jason. ...Show All
Visual Studio An unexpected error occurred while compiling expressions
Hi, I'm having problem in diplaying report (in localmode processing ) in asp.net web application - created using vs2005 & sql2005express. The report is simple, contains a Table to display number of rows from a database-table. The problem is very strange, the report displays absolutely fine if i display the field values directly i.e. =Fields!my_field.Value - b ut, when i use any other expressions in the report, such as =Fields!my_field.Value & "Test" I get the following error. An error occurred during local report processing. The definition of the report 'Main Report' is invalid. An unexpected error occurred while compiling expressions. Native compiler return value: ‘[BC2001] fi ...Show All
Visual Studio 2008 (Pre-release) Consistant but inexplicable error when using where clause.
I have the following code: var q = from m in db.Vms select m; which compiles and runs as expected. However as soon as I introduce a where clause, e.g. var q = from m in db.Vms where m.VmName.Contains( "tttt" ) select m; I get the following error: The type arguments for method 'System.Data.TypedTableBaseExtensions.Where<T>(System.Data.TypedTableBase<T>, System.Query.Func<T,bool>)' cannot be inferred from the usage. Try specifying the type arguments explicitly. All of the correct references are established, i.e. System.Query.dll System.Data.DLinq.dll System.Data.Extensions.dll as well as CSharp3CodeDomProvider.dll I used SQLMetal.exe to pr ...Show All
SQL Server Bulk Insert Task - Where Does The First Row Begin?
Hi, I am using the Bulk Insert Task to bulk copy data from a flat file to a SQL Server 2005 table. The flat file contains pipe ( | ) delimited columns and several thousand records which are {CR}{LF} delimited. The file also contains a header record and trailer record, which contain several words but also contains a ( | ) symbol among those words. E.g.: HEDR | yadi yadi yada 500 | Data Data | More Data | 600 460 | Datum | More More | 705 550 | Data | Data | 603 FOOTR | yadi yadi yada I need to ignore the header and trailer records and just pickup the proper records. But even though I manually set the First Row property to 2 and the Last Row property to 4, It does not pickup the first true record i.e. the record which begins wit ...Show All
