David Richards's Q&A profile
Visual Studio Creating dynamic columns in crystal report using C# 2005
Hi, We are delevoping C# windows application where we want to embed new crystal reports. Is there anyway to create and place the Report Objects(fields, Textbox, Subreport etc) in ReportDocument through C# code at runtime . For ourcase, the number of columns in the report will vary for different scenarios. So we have to control the number of columns and positions at runtime. Is this possible to do it through crystal report Could you give any method in CrystalReport to achieve the above task Thanks, Senthil A I had the exact same problem, and even though I'm more of a VB guy rather than a C# one, I thought I should share this: http://www.c-sharpcorner.com/UploadFile/uditsingh/CR1111022006 ...Show All
Visual Basic inherit datagridview in a class ????????, use interfaces ???????, What the best way for do that ????
I’m building a windows forms application with vb.net and sql. My Application is all Unbound I have a form with a DataGridView and I have some class too I would like my DataGridView load properties like Column Numbers, col Name, Col Type, etc from the each class. What the best way for do that There is no 'best' way, as such: both methods may be appropriate, but it depends on what you want to expose with the control. If you are just extending the properties and methods of the datagridview, you could just Inherit it in a control library. However, it sounds like you may want a UserControl: create a new user control, and put the datagrid on it. This way you can 'hide' relatively easily all the properties of the grid and present th ...Show All
Software Development for Windows Vista How to get possible state transition for a given user
Hi, How can I get the list of possible state transitions for a given user in State machine workflow The PossibleStateTransitions gives all possible transitions. Thanks, Navneet I do not understand why SonaliC's reply was set as the answer. He only asks the right questions I have the same question: given a role, can I figure out the possible transitions Actually, if you bind a userinterface to the possible state changes in the current state, there would be a problem: possible a state change can be achieved through more then one handleExternalEventActivity. Therefor, the interesting question would be, is it possible to query the currently listening handleExternalEventActivity for the possibility o ...Show All
Visual Studio Express Editions Stopwatch Questions
Hey all I have some questions about a stopwatch app that i am working on, first here is my code: Imports System Imports System.Diagnostics Imports System.Windows.Forms Public Class Form1 Dim StartTime As Date Dim EndTime As Date Dim stopwatch As New Stopwatch Dim miletime() As Date Dim mark As Boolean = False Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click StartTime = Now stopwatch.Start() End Sub Private Sub btnStop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStop.Click EndTime = Now stopwatch.Stop() End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.Eve ...Show All
Visual Studio 2008 (Pre-release) Using controls defined in exe-assembly from external xaml-files.
I have a program that can load xaml-pages and resourcedictionarys from an uncompiled xaml-file during runtime. This works fine but one thing that bothers me is that all controls i use in these files has to be compiled in a dll-library, if they are in the main exe it won't work. Take this resourcedictonary as example: <ResourceDictionary xmlns:MyNamespace="clr-namespace:MyControlLibrary;assembly=MyControlLibrary" xmlns=" http://schemas.microsoft.com/winfx/2006/xaml/presentation " xmlns:x=" http://schemas.microsoft.com/winfx/2006/xaml " > <Style x:Key="testbutton" TargetType="{x:Type MyNamespace:GUIButton}"> //Properties here </Style> </ResourceD ...Show All
SQL Server Export to SQL Server Everywhere Database
Hello! I want to export a table in a SQL Server 2005 database to an SQL Server 2005 Everywhere database (sdf file). I use the assistent by calling "Management/Export data". The source is "SQL Native Client" showing to a certain database. The destination is "SQL Server 2005 Everywhere Edition" with an SDF File set. Then after defining the tables to be exported I come to a page showing me the steps of the export. At step "Before execution" I get the error messages (translated from German): Error 0xc0202009: Data flow task: OLE DB error. Error code 0x80040E37 Error 0xc02020e8: Data flow task: Error opening a rowset for "TABLE_NAME". Validate the existance of the object in the database ...Show All
Windows Forms EventHandlers for dynamically created controls.
I am trying to subscribe to the click event raised by the dynamically created LinkButtons in MyCustomTable class. I want to handle these events in the code behind of my webform. In my webform.aspx.cs I instantiate this custom control and pass it in a populated sqldatareader and it returns a table which I then add to the to a placeholder control on my page. This is a very simplified version of my actual control, but it serves the purpose for what I am looking for. I know how to add the event handler in this same class. myLinkButton.Click+=new System.EventHandler(myLinkButton_Click); where myLinkButton_Click is a method name in the MyCustomTable class. I want to define the method to handle the instance Click ...Show All
.NET Development How can a hidden app capture keystrokes when it is not in focus?
I'd like to create an application that is hidden in the taskbar. It's purpose is to capture keystrokes to perform specific scripted actions. How can this be done without having a process that uses large amounts of system resources Use the SetWindowsHookEx() API. You'll find lots of examples both on these forums as well on the Internet. ...Show All
Windows Forms Creating Button Controls at runtime and capturing each of their click events
Hello, I am trying to create multiple buttons at runtime and capture the click event for them (for all of them). However, when I try to capture the click event, I can always only capture the click event for the last button. Anyone know of a way to work around this problem Here is the code I am using: Imports System Imports System.ComponentModel Imports System.Windows.Forms Imports System.Drawing Public Class Form1 Public WithEvents btn As Button Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load For looper As Integer = 1 To 20 'Dim btn As New Button btn = New Button btn.Height = 25 ' Set Size. btn.Width = 150 btn.Left = 20 ' Set Location b ...Show All
Smart Device Development Any class can act like java.lang.Class ?
I need a class that act like java class (java.lang.Class) to create an object that created from class name. Example I define a config file for my application and defined a element that processed by custom class, in java.lang.Class we can use Class.forName("class_name") then we got a object that type is "class_name". And I know that Windows Mobile can not act like desktop Windows (not all method supported, this make me in doubt to reference the vjscor.dll, in vjscor.dll contain the java.lang.Class class), so any class/method can act like java.lang.Class (forName method). Thanks for any reply. Yes, any class can be created from full class name (includes namespace): http://forums.micr ...Show All
SQL Server Counting unique entries in a SQL Statement
I have a complicated problem, and I'm new to SQL so any help would be greatly appreciated. I am creating an export file (fixed width) that contains a breakdown of items on an invoice, and each "export file" can contain many invoices. The problem is that I need to apply an incremental "invoice" count on each line. This isn't as simple as doing a running sum of "1" on each record, because the first 5 rows may all be on the same invoice, and all rows need to be identified as being associated with "invoice 1". The next invoice will be known as "invoice 2" and again may contain many rows, all requiring "invoice 2". Does this make sense EG.: I am shipping products, and the ...Show All
SQL Server Reuse of Field Aliases
I have been working with SQL for quiet a while but think this perhaps is a very basic question that has always escaped me: At my work I was exposed to both, MS SQL Server 2000 and Sybase Adaptive Server Anywhere/Sybase SQL Anywhere. Under Sybase I was able to use aliases in other calculations and filters but i have never been able to do the same with SQL. Example: In Sybase I can write this: Select Price * Units as Cost Cost * SalesTax as TotalTax From Invoice Where TotalTax > 3.5 However if i want to do this in MS SQL 2000 i have to go trough Select Price * Units as Cost Price * Units * SalesTax as TotalTax From Invoice Where (Price * Units * SalesTax) > 3.5 In the long run this is costing me a lot of ...Show All
SQL Server creating a user stored proc
I'm running mssql 2005. And any stored procedure I create in the master database gets created as system procedures since recently. I have created procs in the master database as user procs previously. As sp_MS_upd_sysobj_category is not supported in mssql 2005, does anyone know why this is happening.. or how I can rectify it Thanks I don't actually want to create system procs.. I want to create this proc in the master database and do not want it to be a system proc.. just a normal user proc.. I was able to do so since recently..But I think some thing has gone wrong and now when ever I create a proc, it gets created as a system proc... I did run the sp_MS_upd_sysobj_category with 2 but I understand that it's obsolete now...Any idea ...Show All
Windows Forms WriteXml
In a Visual Studio Windows Application Form, I'm trying ot export the data to an Excel file, but I'm getting the message 'WriteXml is a not a member of System'.Windows.Forms.Button... Question 1 - why is it not in the list Question 2 - then how do I export the data Thanks I just try to guess what you want to do sir: I think we can using XML format Excel file, and waht we need to do is save an Excel file to xml format; than we can see how it is bulided, first may be some schema, then style then row by row, so we can write row by row to form that xml file hope it help you ...Show All
Visual C# Obsolete System.Net classes.
Im trying to run this snippet using System; using System.Net; class showIPs { public static void Main( string[] args ) { string name = ( args.Length < 1 ) Dns.GetHostName() : args[0]; try { IPAddress[] addrs = Dns.Resolve(name).AddressList; foreach( IPAddress addr in addrs ) { Console.WriteLine( "{0}/{1}", name, addr ); } }catch( Exception e ) { Console.WriteLine( e.Message ); } } } but I keep getting the following error :( c:\c-sharp\arr.cs(10,30): warning CS0618: 'System.Net.Dns.Resolve(string)' is obsolete: 'Resolve is obsoleted for this type, please use GetHostEntry instead. http://go.microsoft.com/fwlink/ linkid=14202' I went to the link.. I just dont understand how to fix it. As far as I know.. I think I ...Show All
