Answer Questions
Jassim Rahma Oledbcommand issue
I have a problem with my piecie of code. Dim SelectID, returnVal, ErrID, Head, Tail, NewErrorID, where_cond As String Dim LenErrID, LenHead, LenTail, LenVal As Integer Dim dr As OleDb.OleDbDataReader If ModuleID <> "" Then where_cond = "where Module_ID='" + ModuleID + "' Group By Module_ID;" Else where_cond = "" End If 'this will select the last error_id that in this table. SelectID = "Select Max(Error_ID) as Error_ID,Module_ID From Error_Tracking " + where_cond + " " OleDbConn = New OleDbConnection(connStr) cmd = New OleDbCommand(SelectID, OleDbConn) OleDbConn.Open() 'cmd.Connection.Open() dr = cmd.ExecuteReader Do While dr.Read ...Show All
noyesar Read and write *.csv File
How can i read *.csv file and import data in database also read data from database and write in *.csv file Hi, I am unable to above mentioned reference. Please let me know how can i find it. As currently i cant see it in my add reference tab. Thanks, Shabber. If you're using VB.NET, it has built-in support for parsing .csv files. If not, you can always add a reference to Microsoft.VisualBasic... I'm assuming you use C#. First, add a reference to the Microsoft.VisualBasic assembly with Project + Add Reference. Now you can use the Microsoft.VisualBasic.FileIO.TextFieldParser class . Here's some sample code: using System; using System.Windows.Forms; using Mi ...Show All
Andre Odendaal how to migrate db to new release w/o refresh?
I have an app which uses an Access database. Its an application resource marked as 'datafile' and property marked as 'Copy if newer' . It does install in : C:\Documents and Settings\carl\Local Settings\Apps\2.0\Data\4LMXMV30.28M\ZVD7XGKQ.RRY\stad..tion_8edc8641ebc4943c_0001.0000_3eaaf0a262f9821e\Data However, each time I release a new version, everyones' database get replaced. I'm using VSE C#. Whats the method by which I can write it the first time, but prevent subsequent overwrites Also posted under: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=935578&SiteID=1 Some related info, which did not ...Show All
Dan Imbrogno Can't disable a button
I am programming in c#. I have a button on my form that when clicked, it plays a wav file using the PlaySound method from winmm.dll. The wav is about 3 seconds long. The problem is that if I keep clicking the button during the 3 seconds the sound is playing, it queues all of the clicks, and plays the wav over and over. My Button is named btn. So I tried: this.btn.Enabled = false; PlaySound(...); this.btn.Enabled = true; Doing this successfully greyed out the button while the sound is playing, but it still accepts clicks, so it didn't fix my original problem. Is there some way to clear the event queue Or is there something else I'm doing wrong. I just want the button to not work while the sound is playing. I have also tried ...Show All
Jo&#227;o Santa B&#225;rbara How to access currencymanager from listbox DrawItem event
I have a dataset with fields (duedate, title, author, isbn) tied to an ownerdraw listbox so that I can format all of the fields in a single row as in: DataSet ds = lda.GetItems(1833); listBox1.DataSource = new BindingSource (ds, "Items" ); ---------------------------------------------------- Due: 1/1/2007 History of the Decline and Fall of the Roman Empire , Edward Gibbon ISBN: 12-23456-89 ----------------------------------------------------- What is the syntax (C#) for accessing the individual row cells in the bindingsource from the drawitem event The listbox item will contain a datarowview with the information. Here is a simple example that just draws th ...Show All
John Campbell-Higgens How can I make update version for application which was signed with certificate now expired?
If I change expired code signing certificate to new one and publish updated application, client will fail to launch. And code signing fails if I try to use expired certificate. How can I make update version for application signed with old certificate I'm member of company "aoky" is belonging to and I arranged new certification. So, I investigate properties of old and new certifications. Then, "OU" option of "Subject" property is different. I guess this is the cause of failuer. But I'm not so good at code signing architecture, so I can't make sure that if make no change in this property then exchange of key will be success. Please give me some comment about sureness. # Please forgive my ...Show All
Agent_ Can't modify assembly properties in deployment project
I have a deployment project with a number of assemblies in the file system application folder. These assemblies have been placed there as a result of adding the primary outputs from several projects. Some assemblies are referenced by more than one project, and as a result are listed twice (and cannot be deleted). This causes the warning "Two or more objects have the same target location" to be generated when the project is built. I can stop this warning by giving each of the duplicated assemblies a different condition, and this works fine - until I close Visual Studio. It then turns out that the condition property has not been saved - it has dissapeared. In fact, it seems that any property change on these assemblies takes eff ...Show All
egomezb Help please with richTextControl
hi im using c#, I have 2 richTextBoxes box1 & box2 if I go: box1.Rtf.ToString(); i get a string like: {\rtf1\ansi\ansicpg1252\deff0\deflang2057{\fonttbl{\f0\fnil\fcharset0 Microsoft Sans Serif;}} {\colortbl ;\red255\green0\blue0;} \viewkind4\uc1\pard\cf1\f0\fs36 Hello, this is a test\cf0\fs17\par } how do i append this text to box2 kepping the textes font and size ect Thanks. I tried box2.AppendText(theString) but it appends the code of the text, not the text. Sorry, i should of said, the string is going to be sent over a socket, so on receiving side i'm going to have to add the text. It's ok i got it. box1.copy b ...Show All
PJFINTRAX Image Resources
I created 2 image resources in the frm.resx file. I added them by selecting to use an existing image in the project root. When I tried to use them: new Bitmap (GetType(), "NotifyBG.bmp" ), Color .FromArgb(255, 0, 255) It keeps throwing an exception saying the resource does not exist. The name of the resource is "NotifyBG". I tried using "NotifyBG" instead of "NotifyBG.bmp", but I get the same error.. Any ideas Hi Keith! Please note that the overload of the Bitmap class constructor you are trying to use will figure out the full name of the resource based on the type you pass in (please see Bitmap(Type, String) for details). Assuming that you are using Visual Studio 2005 I ...Show All
gkostel Application Start Event for Windows Application
Hi All, How can I get the application start event for Windows application developed using Visual Studio 2005 in C# languag I could get the event for a VB.net application but not the C# applciation. Regards, Santha In my main i show a splash screen and load several things before my application really start. It really starts at Application.Run(), so I guess that whatever you do before that, is similar to your Application_BeforeStart(). [ STAThread ] static void Main( string [] args) { Application .ThreadException += new ThreadExceptionEventHandler (Application_ThreadException); Application .EnableVisualStyles(); Splash splash = new Splash (); ...Show All
PaulSw Using Spy++ to Assist with Automated Testing
Hello: I can't tell you how glad I am to know that there are so many Spy++ enthusiasts out there. I only discovered the tool last night, and thought it was truly awesome that the tool detected an app that I was debugging from VSTS (which is incredible, by the way). Anyway, I started the app, and intentionally caused an error, which in turn, launched a MessageBox. Spy++ was able to detect both my app, and the error message (MessageBox). How can I now use information supplied by Spy++ to simulate clicking the OK button on the MessageBox Wish to do automated testing and I am pulling scenarios from a database, so that I can test numerous inputs at once. The messageboxes popup by design. I don't wish to suppress them ...Show All
CruzPedro Can't build (or publish) if I want XP styles with a manifest file
Hello, I currently have my application using a manifest file to get XP visual styles (because I know that Application.EnableVisualStyles() is buggy -- at least it was in .NET 1.1). My manifest file looks like this: < xml version="1.0" encoding="UTF-8" standalone="yes" > <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="Sistema Integral Curves" type="win32" /> <description>Windows XP Visual Styles</description> <dependency> <dependentAssembly> <assemblyIdentity ...Show All
daraneko how to disable the pass of button shortcuts keypress to the underlying forms
Hi, I have a mdi windows application with a menuitem . on clicking first menu item am showing a child form1 . on clicking second menu item am showing a child form2. in child form1 i have button &Apply and &Exit. in child form2 i have only button &Apply . i have clicked both the menuitems (i need both child forms to be open) when Alt+A is pressed the focus passes to the previous child form form2 (ie. active child form). when Alt + E is pressed the focus passes to the previous child form form1. how to disable the pass of button shortcuts keypress to the underlying forms ie) from form 2 to form1 Thanks, Shanthi. I can't reproduce your problem, neither in VS2003 ...Show All
Alexnaldo Santos Tricking the Designer/PropertyGrid/Serializer
Hey Guys. We have the following classes: public class Class1 : Component { private Class2 _class2; public Class2 MyClass2 { get { return _class2; } } } public class Class2 { public event EventHandler MyEvent; } I want to show MyEvent in the PropertyGrid when it's selected item it an instance of Class1. I managed to get it to show this using a custom designer and this code: public class Component1Designer : ComponentDesigner { protected override void PreFilterEvents(System.Collections. IDictionary events) { base .PreFilterEvents(events); ...Show All
SarathChandar DataGridView - Position editing control?
The rows in my data grid are taller than the default height. This means that the combo box is smaller than the height of the cell. When not in edit mode, the text is properly aligned to the middle of the cell; when the combo box becomes active, it moves to dock itself to the top of the cell. Is there any way I can control that behavior and force the combo box to center itself vertically in the cell there is some mistake in former reply,try this: Me .DataGridView1.Columns(1).DefaultCellStyle.Alignment = DataGridViewContentAlignment.BottomCenter If it dosn't handle,try below: Me .DataGridView1.Rows(0).Height = 100 Dim style As DataGridViewCellStyle = New DataGridViewCellStyle Dim ...Show All
