Dottj's Q&A profile
Visual C# C# and SQL Query
Ok... Ive started learning C#. I have loaded a datasource odbc connection and dropped 1 of my tables onto my form. Now I also have a textbox and button on my form. The text box takes the current date and converts it to excel serial date and stores that into a variable 'serial'. Now I need to make a query on my table. I can create a query comparing 2 columns without a problem. My problem is that I cannot use my variable 'serial' in my query. Here is what it looks like: SELECT ... FROM ... WHERE WHERE TranDetail.EndDateTime = TranHeader.EndDateTime AND (TranDetail.EndDateTime >= @serial) I am using the query builder. I cannot get the TranDetail.EndDateTime >= @serial to work. I know its not able to use my variable ...Show All
Visual FoxPro Exporting to Excel in multiple spreadsheets
I have my program exporting to excel just fine, however here lies my problem: Some of the databases are reaching the excel spreadsheet's 65,536 record limit. I actually had something working to where it would copy the records up to 60,000 (or whatever number you specified) - when it reached this limit it created a new spreadsheet in the workbook and started copying from there. There was one HUGE problem with it though - it was slower than molasses in winter. It took roughly 10 mins just to copy over 20,000 records becuase it was doing everything one record at a time. I felt this was a bigger problem than the 60,000 limit so I just started using this instead: copy to &cFilename fields &cFields type xl5 The problem now is that ...Show All
Visual Studio Crystal Report for Visual Studio 2005 can't render Khmer correctly
Dear all, I got some strange problem when rendering Khmer script in Visual Studio 2005 Crystal Report. I understand that to render indic script (like Khmer) correctly, there is something related to the Uniscribe engine (usp10.dll). I also tried to copy the existing usp10.dll in "C:\WINDOWS\system32" to "C:\Program Files\Common Files\Business Objects\2.7\Bin" where there was already another usp10.dll. Since my Windows XP Pro renders Khmer very well, so I suppose the usp10.dll in "system32" folder is the correct one. Oops! My crystal report now renders Khmer very well (http://static.flickr.com/81/267567847_5612d9e237.jpg v=0) , but when I attach that report to crystalReportViewer control, I got the breaking-ligation script (http://static.fli ...Show All
Visual C# Dynamic Query in Visual C# 2005 !!!
Hello everybody, I'm trying to change my Query at runtime. Actually, i have a Query in my TableAdapter and i need to change it's SQL according to what user enters on the application form. Does anybody know how I may do it Thanks in advance. Mathew You mean like public string AssembleSQLString( string fieldName, string tableName) { string s = "select " + fieldName + " from " + tableName + ";" ; return s; } You'll need some error checking, of course ...Show All
.NET Development Adding Row to Datatable in Memory
Hi , My Requirement is i want to Create a Datatable in memory and add Columns and add Rows .And Inserting data on it . To Insert data I am Going to Use TextBox.As MSDN I Knew how to Enter it in SourceCode but I need to Enter Data By TextBox. Following Code i wrote...But it is not My Requirement ..as Earlier Mentioned i want to Enter Data by Text Box. Dim Mytable as new datatable Dim Col_one as new dataColumn Mytable.Columns.add(Col_one) Dim Row1 as datarow=Mytable.NewRow Row1(Col_one)= "String value" Mytable.Row.add(Row1) Datagridview1.datasource=Myytable Referencing to your code: You have not defined any Type for your table, so it defaults to string. Therefore, in this case you don't need any casting. The solut ...Show All
SQL Server How to add link in a report as a button?
Hi, I want to add a link in a report, possibly a url link or a link to other report. One way of doing this is to go to properties of textbox and then update the jump to option. But how to do this through a click of a button, inside the report I am having Microsoft Visual Studio 2005, designer's version. thanks You can use the Action property of a textbox and format that as a standard link (underlined). For a 'button', I believe you'd have to make an image per button and then use an image control, and again leveraging the action property. There may be custom controls out there that will make the button for you and you'd just set the caption.. but I don't know for sure. ...Show All
Visual Studio Express Editions Time
I am very new to visual studio express C# edition. I would like to know if there are any commands that deal directly with the handling of time/date data Thanks Jon no problemo DateTime myTime = DateTime.Now; myTime = myTime.AddHours(1) //will add 1 hour from the current date time. placing a - infront of the number will decrease the time does this help There are many methods in the DateTime class like AddHours, AddMinutes,AddDays etc.... ...Show All
.NET Development Generating proxy classes to individual files?
I have 6 separate wsdl files which represent various HL7 v3 interactions. Each of these wsdl files declare the same base HL7 v3 data types. Each wsdl is about 350K in size. I have used Thinktecture's WSCF v0.6 tool to generate a separate class file for each data type (class). I have some minor problems using WSCF, so I was wanting to do the same thing using the standard .NET framework tools, i.e., wsdl.exe or wsewsdl3.exe. Unless I have missed something obvious, I cannot find a way of doing the same thing using wsdl.exe or wsewsdl3.exe. A couple of notes to assist in your answer: I am not the maintainer of the wsdl, so changing the source wsdl is out of the question There are 348 generated classes (1.5MB of C#) in all of the ws ...Show All
Smart Device Development Bluetooth anyone???
Does anyone have or know of where I can obtain exaples of bluetooth communication set up in vb.net I am attempting to set up communications between a bluetooth mobile printer and a handheld device, so if the example where compatable with the compact framework I would be that much more excited. I have been looking for a while now and have hit a few dead ends (dead links) and am begining to get frustrated. I am suprised at the lack of information on the topic considering how great the technology is and how many hardware solutions are out there. If you are sure, that your device have Microsoft Bluetooth stack you can find some free libraries (start from OPENNETCF). But if the targets are many different models PDAs you can use only thes ...Show All
Visual C# How to deploy an embedded file?
I have a very simple console application I've written that copies a file from a DVD drive to the local temp directory. What I'd like to do is make it as idiot-proof as possible (you know murphy's law regarding end users...); to that end, what I did is to add the file to the project. Now, what I'd like to do is just take that file and copy it to the temp directory. What's the cleanest and easiest way to do this (Yes, I'm new at this...) Thanks! not sure I follow. Do you mean you have a file, say for example a text file, and you have embedded this as a resource file, now when running your app you want to extract this file to wherever you like - is this what you are asking ...Show All
Windows Forms handling PaintEvent in a class
I can already work with paintevents and graphics in the mainform, but when I add a class and I want to add a pe.Graphics.Drawline() statement, He gives an error. Something with returning a '0' argument( pe => paintevent) How can I also work with drawings in a class I see to options in your case: 1) Make the Path class a Control (that is make it inherit from control). This will allow you to override the onPaint method and will give you a new Graphics object to draw on. The code will look like: class Path : Control { protected override void OnPaint( PaintEventArgs e) { Graphics gr = e.Graphics; Rectangle rectx = new Rectangle (); PaintEventArgs ...Show All
SharePoint Products and Technologies How to show user presence in MOSS
I've been asked to display the presence of some users in a site. I'm trying to find out what I have to do to do that, but can find no documentation. Has anyone tried this I have discovered that there is the 'Colleague Tracker' web part in My Sites, which seems to do this - but it's not available on a conventional site. I was also trying to use the 'Site users' web part - but it doesn't seem to be able to show presence (although I've read some comments which suggest it should be. 1) Does anyone know of any documentation 2) What are the prerequisites for showing presence 3) What web part should I use Do I have to make the Colleague tracker web part available on a team site My apologies; I didn't ...Show All
Visual Studio 2008 (Pre-release) Custom window border / caption
Does WPF provide a convenient way of replacing the border / caption of window with a custom version The latest release of Blend provides templating for Window borders and captions, but all changes made to it render inside the Windows' own border. I found two solutions: the Win32 route and by setting WindowStyle to None and Background to Transparent (this ). As far as I understand both of methods involve re-implementing functionality for resizing, system menu and minimize/maximize/close buttons. I am wondering if there is a more elegant solution, considering the Blend support for it. No, there is no support beyond what you are already doing for manipulating the window "chrome" in WPF. You will ha ...Show All
Visual C++ Overriding default entry point
I have a project that has been ported from Studio .net 2003 to Studio .net 2005. IN the 2003 .net project I specified a different Entry Point via the linker->Advanced->options dialog. This allowed my code to gain control prior to the ctors or Global constructors running. This code is now broken in .net 2005. The global constructors are getting called before my entry point gains control. How do I get this to work in .net 2005. There is no way to tell the order of creation of global objects, the fact that it worked is pure luck as far as I understand. You can put your global variables inside global functions, something like that: was: CMyClass g_myObject; need to be: CMyClass & GetMyObj ...Show All
Software Development for Windows Vista Calling CreateProcessAsUser() from service
According to some MS documents (e.g. http://www.microsoft.com/whdc/system/vista/services.mspx), it should be possible to use CreateProcessAsUser() API in a Vista service to create a process in user session. I am trying to achive this, but the function returns error code 1307 (ERROR_INVALID_OWNER) = "This security ID may not be assigned as the owner of this object." Does it work for somebody Many thanks in advance. Mine was the same senerio, calling CreateProcessAsUser from service. I followed the steps given by you, and it really worked for me thanks HANDLE hTokenNew = NULL, hTokenDup = NULL; HMODULE hmod = LoadLibrary("kernel32.dll"); WTSGETACTIVECONSOLESESSIONID lpfnWTSGetActi ...Show All
