Polity4h's Q&A profile
.NET Development How can access to LPT1 directly
hi I need to send data directly to printer port.So I want to know what is similar command for this in VB6 : open "lpt1:" for output as #1 Remove the colon from the name. Be sure to use OPEN_EXISTING for the 5th parameter or else it'll fail. Michael Taylor - 12/13/06 ...Show All
.NET Development retrieving last entry
i have a table ID. so how can i retrieve the ID immediately of the last entry after inserting the data into the table if (command.Paramters[0].Value != null) { return command.Paramters[0].Value; } am i right ...Show All
SQL Server Accessing the variable in Execute SQL Task
I have a variable SYear with the data type Integer and the value 2005. Connection type is OLE DB, and my sql statement is: DECLARE @MyYear Int SET @MyYear = I have set the variable User::Syear as Input with the parameter name=0, there is no result set. I set BypassPrepare both True and False. However, this simple statement does not work. I keep having an error. If I put integer value directly into @MyYear, it is fine. What is wrong in here Somebody help me! This is VERY annoying. It is a type cast problem between the .Net type and the SQL type. When it can't cast the .NET type to the SQL type you selected, it just fails SILENTLY and gives you NOTHING in your task and NO ERROR. What EXACTLY i ...Show All
SQL Server How to create cumulative S-curve?
Hi I need to make two reports: one containing the Raleigh chart, the other containing a cumulative curve. In the raleigh report I do this: Per project I can see the amount of mandays on a timebase(weeks). For the s-curve (cumulative curve) this needs to happen (and I dont know how): I need to see the sum of the amount of mandays on a timebase(weeks). An example: In raleigh curve: week1 has 20md(mandays), week2 has 30md, week3 has 15md, week4 has 5md In s-curve the same values should give: week1 has 20md, week2 has 50md(30+20), week3 has 65md(50+15), week4 has 70md (65 + 5) I tried a sum of a sum but thats not allowed in RS Anyone who knows how to generate an s-curve (cumulative curve) ...Show All
Visual Studio Team System Unable to see information when user added to project administrator group
I add three user to Builtin Project administrator group and try to loging with that user, i am not able to see any information of project and it give error that u not have enough permission on TFS. Then i made custom group and give all permission for project then everything goes fine. Can some one guide me what would be wrong I'm not sure I fully understand who you assigned permissions to. In step 2, you say "we gave permission according to role". Did you grant these permissions to the "Global group" in step 1 A different TFS group Domain groups Domain users In step 4, did you add the user to Domain groups, or TFS groups What group(s) did you add the Project Administrator's ...Show All
Windows Forms Navigating through pictures on a form?
I am programming with C# in Visual Studio 2005. I am trying to create a form that will display a single image from a set of 5 pictures. Then use previous and next buttons to navigate forwards and backwards through that set of pictures displaying each one. I have created a 2nd form which when loads up displays the first picture using the code :- pictureBox1.Image = Image .FromFile( "C:\\Documents and Settings\\My Documents\\pics\\pic1.gif" ); I know that I need to declare and initialise an array to hold all the images in and then use a for loop to display them but I am having trouble working out how to do this as I am not an experienced programmer. If anyone could help me out with this it would be much appreciated! ...Show All
.NET Development Going from string-> datatable, or even string->IDataReader?
Hi, I have some data that is coming into me from an Inbound TCP connection. The data is already perfectly layed out as a datatable - it is literally a pipe-delimited table, with columns and rows. Rows are deliminated by newlines, and columns delimited by pipe. Anyway, once I have this data as an array of byte(), or one big string... How can I quickly insert this into a SQL table using the SqlBulkCopy object It seems that SqlBulkCopy.WriteToServer() only accepts either a datatable or an IDataReader.... My question is, do I really *have* to loop through my string/byte array row for row and convert this to a datatable There's no way to easily shove the string/byte array into the WriteToServer() function (or into a DataTable/IDataRead ...Show All
Visual Studio 2008 (Pre-release) How To: Attach event handler to element in DataTemplate?
This question/problem is a little bit esoteric, but hopefully someone has seen it before... I need to attach an event handler to the Loaded event of Image elements within a DataTemplate. The Loaded event handling method is in a utility class, so I can't use XAML to attach the handler. In a Window's Loaded event handling method I call this method in the utility class : FrameworkElementFactory factory = listBox.ItemTemplate.VisualTree; while ( factory != null ) { if ( factory.Type == typeof ( Image ) ) { factory.AddHandler( Image .LoadedEvent, new RoutedEventHandler ( OnImageLoaded ) ); break ; } factory = factory.FirstChild; } There are two problems, one is not too bad (just odd) and t ...Show All
Windows Forms Convert xml to a DataSet
Hi there I've been given a file which has xml. I'm trying to get the file to create a typed dataset so I can access its contents easily and nicely. I've run xsd.exe against the xml file and produced an xsd file no errors reported. I then brought the xsd file into my C# project in VS 2005/.net 2. That all works ok as well. Now I try to add a dataset from the tools window and it asks if I want it untyped or typed based on my xsd file. I go for typed and get a TargetInvocationException. The error doesn't say what caused it, just that it got the exception. I do get soime errors and messages in the error list window of VS though - Warning 1 The 'homePlayers_Constraint1' identity constraint is not declared. D:\My Documents\Visual Studio Proje ...Show All
Visual Studio Express Editions Easy Question
I am newbie in VB. I want to automatically size the form when it is loaded. i.e. it automatically adjust the form size whether it is loaded in 17'/a5''/12'' screen monitor. please tell me what is the method I've to use I appreciate any help. form1. You've got two options... you can either set the form's Size property ala: form1.Size = new Size(150, 100) or you can set the height and width of it separately: form1.Height = 100 form1.Width = 150 All you need to do is do your own math to decide how big you want it. Is this what you are looking for ...Show All
SQL Server OK button doesn't Work In Report Manager RS2000
Hi, i have a new instalation of RS2000 under Windows 2003 Server SP1 with a fresh reaplied Windows Service Pack 1 and RS2000 Service Pack 2. My problem is that any page of the report manager with a "OK" button, that button doen't do nothing, it is enabled bu doesn't do any action. Can't figure this one out Need Help Thank's PS: Is did work early on this machine but stop working without notice, or any change at all. Hi, We have installed SQL Server 2005 with Reporting Service in a Windows 2003 Box. While working with the Reporting Manager through the browser we are gettting a strange problem. Whenever we are making any changes through Reporting Manager and trying to save the OK or Apply button is doing absolu ...Show All
Visual Studio Team System Lazy question re associated changesets
I know I could try this out, but it would take a while to log the work items and run the builds! Could someone explain what happens when the value of <UpdateAssociatedWorkItems> changes The thing is, we will be running nightly builds and hourly semi-continuous integration builds which I would like the build results to show associated changesets since the last time the build type ran, but does this mean that associated work items can only be logged with one build type I would like the CI build to list everything that has changed in the last hour, in case someone's changes break the build, but I would also like the nightly build to show what has changed in the last 24 hours (including all the changesets already associated with the C ...Show All
Visual Basic How to secure sensitive data in connection string?
Hi. I am creating Windows Application using VB.NET 2005 When I add new data source to my project using, data source configuration wizard it asks if I want to exclude the sensitive data in the connection string. I know it will just show password and user id in the connection string in the app.config if I include them in the connection string. But how can I encrypt or set these information in the application securely I seen alot of examples done w/ ASP.NET (encrypting web.config) but I can't find any for apps.config. Thank you. I'm also looking for a way to encrypt connection strings in app.config. I found no good way to encrypt the actual file like you do for ASP.NET 2005 web.config. If ...Show All
Visual C# Array of forms
Hi to all, I have a silly question. I'm creating an array of forms for a kind of MDI application. Usually, when creating a single form, I use, for example: private Step1 frmStep1 = new Step1(); But let's say that I'd like to create an array of forms Step2. What syntax should I use I tried: private Step2[] arrStep2; arrStep[0] = new Step2(); But this gives me the instant warning Field 'Project.Form1.arrStep2' is never assigned to, and will always have its default value null and an run-time exception. What am I missing here Thank you for the answer. Best regards! First you would need to intialize the array itself (and say how many elements it will contain) int numberOfElements = 10; arrStep = new Step[numbe ...Show All
Visual Basic To Microsoft staff. Would you call this a bug?
Hi, Please read my concern in thread>> http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=836609&SiteID=1 thank you in advance. :-) Regards, S_DS I think KitG answered your question. From the signature - you'll notice he has a microsoft address and is in fact on the VB team. This is more an issue with the .NET framework Common Language Runtime rather than VB specific issue. But I would probably say its a current design limitation. ...Show All
