ariochBob's Q&A profile
Visual C# Enum GetType
Hello, I’m experiencing a strange problem, with Enum: I can do the following with WindowState (which is an enum): String s = typeof(WindowState).FullName And s “System.Windows.WindowState”. Now if I try Type.GetType(s), I get back a null What’s going on Is this because an Enum is a value type Thanks Houman OK, I figured it out: GetType has an overload Type.GetType(string, bool) takes in a boolean. If set to true it throws an Exception. After looking at the exception I realized that I needed to use the AssemblyQualifiedName Instead of the FullName. Now everything is cool. Thanks Houman ...Show All
Visual Studio Tools for Office How to migrate Outlook VBA folder based solution to Visual Studio for creating Outlook Add-in
I have been studying the evaluation version of Visual Studio 2005 and trying to figure out how to migrate a folder based solution I have created for Outlook 2003 in VBA and VBscript to Visual Studio 2005 so I can convert my folder based solution into an Outlook Add-in. Can't find any good tutorial info and haven't been able to figure it out in self-study of VS2005. Can anybody point me in the right direction or give me a referral A good place to start would be to tell us what events your VBA solution uses and whether you're working with Visual Studio 2005 or the newer Visual Studio 2005 SE. ...Show All
Visual Basic oledb not recognizing autonumber field in Access
I have an Access db with the primary key as a 'autonumber' field. Records are updated via code just fine but Inserts fail with a message of "number of query fields and destination fields not the same". This results (I assume), from not providing a value for the first field which is the autonumber field. I have the identical db structure in a mssql db and I am using the same insert statement with sql classes and all is well. If I add a record via Access the field is incremented appropriately. I looked at the field properties of the Access db via .net server explorer and the field is described as an oledbtype.integer and nullable = false, no mention of autonumber or identity. The bottom line is the autonumber function is not firin ...Show All
Visual Studio Express Editions overload statement fail because no accessable 'DrawString' accepts number of argument
Private Sub pdPrint_PrintPage( ByVal sender As System.Object, _ ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles pdPrint.PrintPage ' This procedure prints the sales report. Dim intCount As Integer ' Loop counter Dim decRevenue As Decimal Dim decTotalRevenue As Decimal Dim intVertPos As Integer Dim strFormat As String = "{0,27}{1,15}{2,10}{3,8}{4,12}{5,10}" ' Print the report header. e.Graphics.DrawString( "Demetris Leadership Center" & _ "Sales Report" , New Font( "Courier New" , 10, _ FontStyle.Bold), Brushes.Black, 150, 10) e.Graphics.DrawString( "Date and Time: " & Now.ToS ...Show All
Visual Studio Express Editions Visual Basic 2005 Express Edition Data Binding is not updating the database
Hi Microsoft Community, I'm a new visual basic developer and am using the visual basic 2005 express edition with sql server 2005 express edition. I've been going through some lessons and have encountered a situation that I'm hoping someone can identify what the issue is. When creating a form with listbox and textbox components, I first request data from a table called customer. I'm using a table adapter to manage the connection, request and response from my sql server express database called mycompany. Upon the return of the data, my intermediate dataset is populated with the requested data. I'm sure the data has been retrieved because by utiizing the binding navigator component, I can view the data. I have t ...Show All
.NET Development Releasing dBase (OleDB) resources
Hello all. I've digged Inted and found no answer for problem I found. When I connect the dBase files, the directory where dbf files are stored cannot be removed anymore untill the process (application) is closed completly. Closing datareader, connection etc doesn't help. a bit of code: OleDbConnection conn_batch = null; OleDbCommand cmd = null; OleDbDataReader dr_batch = null; conn_batch = new System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + data_dir + ";Extended Properties=DBASE IV;"); conn_batch.Open(); // here the data_dir directory can be still deleted cmd = new System.Data.OleDb.OleDbCommand(); cmd.Connection = conn_batch; cmd.CommandText = "SELECT * FROM BATCH" ...Show All
SQL Server osql
i'm trying to execute some scripts created by the express studio script wizard. i can connect with the studio, the website (asp worker) but i can't create the right cmdline for osql ..... this is my osql line ...... C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn>osql -S (local)\\SQLEXPRESS -U sa -P sablah -i run.sql....... this is the error i'm getting in my logs Error: 18456, Severity: 14, State: 16. 2006-12-22 15:30:45.11 Logon Login failed for user 'sa'. [CLIENT: <local machine>] "Server=(local)\\SQLEXPRESS;Database=ggmi;User Id=sa;Password=cr79cr02;Trusted_connection=false;" ; the following is the working connection string for my aspworker. "Server=(local)\\SQLEXPRESS;Database=ggmi ...Show All
Visual Studio 2008 (Pre-release) XLINQ !!! is it stable ? is it recommened !?
Greetings fellow developers, i have a new big asp.net project and i am trying to decide either to invest time in developing my DAL with XLINQ as i am working under a deadline stress. my application will require working with xml files coming from (mssql, mysql) databases. i was wondering if there are specific areas i rather start with in my research. so far i dont know wht to dig in more (XLINQ or DLINQ) i know i am gonna get replied from the experts here so thanks for much appricated help inforward. kindest regards, XLinq is under development and the spec itself is in flux. It will not be released until the "Orcas" version of Visual Studio, and I don't believe the schedule is public at this point. So, as much as I would ...Show All
Windows Forms ListBox control changes selection on MouseDown, not MouseClick - can this be changed?
Hi all, I have a class that inherits from ListBox and provides drag/drop functionality. I'm finding that selecting multiple items to drag is frustrating, because ListBox doesn't handle a "multi-select-followed-by-drag" operation in quite the same way as ListView (or, eg. Windows Explorer) Try this: Open your "My Documents" folder, select a file. Hold down Ctrl and click a few more to add them to the selection. Now - if you mouse-down (ie. click but don't release) the left button on one of the selected items, it'll allow you to pick them up and drag them. The item selection doesn't change until you release the mouse button. The WinForms ListView control also behaves this way, but the ListBox control appears to u ...Show All
Visual Studio Tools for Office Retrieving the COMClass factory failed???
Hello all, I need a tip on how to make this VSTO document (xl wb) run on the client's machines. I've got all prerequisities taken care of, but the setup program aborts after having shown this message: Retrieving the COMClass factory for component with CLSID= {A87AB30C-5E9F-4F45-9387-B15F2AE3D55F} failed due to the following error: 80040154 I don't use any COM dll:s in my project so this has to have something with VSTO to do. Anyone have a clue Any tip appreciated! /kk Hi, Looks like the VSTO storage wrapper hasn't been registered properly. Is the VSTO Runtime installed on your client machine If so you'll want to repair it. Alternatively, you can run regsvr32.exe on "%CommonProgramF ...Show All
SQL Server Recursive Hierarchy
I have the following agent’s structure on the agent table. 16 ---17 -----18 ---------19 --------------20 Where Agent 20 sold the product and he is under 19 and 19 is under 18 and 18 is under 17 and 17 is under 16. I need a function that allows me to enter agent 20 and it return agent 18 since 17 and 16 are not longer valid agents but they are still on the table. In the agent structure could be more than 5 levels. Thank you In that case, you'll need to use a temporary table, a loop and a processed flag to achieve the same kind of thing. create table #agents (agentid int, active bit, processed tinyint) insert into #agents values (@agentid, 0, 0) while (@@rowcount > 0) begin update #agents set ...Show All
Windows Forms Add-in for Outlook not displaying on other users PC’s.
Hi. I have just completed my first add-in for outlook 2003-2007 and installed and tested it on my machine where it works as expected (creates a custom commandbar and adds a button to it which triggers an event). When i right click my tollbar area i can see that my custom toolbar is checked and available. However when i install the application on other users computers the installation says everything went ok and it finishes, but when i open outlook on their computers its not there and neither is it available under the toolbar menu. We are using XP Pro and my PC uses the Office 2007 beta 2 and theirs are Office 2002. Thanks in advance Johan Yes, they all have .NET 1.1 installed. Just to make sure i installe ...Show All
SQL Server Need assistance with Duplicate Select Statment
Any help would be appreciated here. My question is two part: 1.) Select duplicates that match any of a number of columns for example... The email is the same OR The homephone is the same OR The mobilephone is the same OR The address1 is the same The uniqueID is ConsIntID My Select Statement: (Which does not work) SELECT CONSINTID , FIRSTNAME , LASTNAME , EMAIL1 , ADDRESS1 , HOMEPHONE , MOBILEPHONE , CREATEDATE , USERIDS FROM CONSULTANTS WHERE CONSINTID IN ( SELECT CONSINTID FROM CONSULTANTS HAVING COUNT ( HOMEPHONE ) > 1 OR COUNT (MOBILEPHONE) >1 OR etc.... ) ------------------------------------------------------------------------------------------------------------------------ ...Show All
Visual C++ How the AutoPointer works in VC.
Need more information about how the compiler & runtime deals with auto pointer in vc. Thanks in advance -Partha You cannot use autoptr for COM objects. COM objects are not deleted with delete but with the last call to Release which lets the COM object decide when and how it should be freed. There is a class CComPtr<IYourInterface> which you could use instead. That helps in calling Release upon its destruction. The concepts of autoptr and COM objects are quite different: COM objects are shared, so multiple clients can get a reference to that object. autoptr has only one single owner. Every assign hands over the object, so only the last owner may use, pass on or free the object. -- SvenC ...Show All
SQL Server harnessing Reportviewer toolbar buttons
Hello everyone, Well ive never used Reportviewer before and ive been trying all this week to harness the events in the buttons of the reportviewer toolbar... the thing is that i need to hide the toolbar for UI reasons but i dont know how to make my own buttons to have the functionality of those included in the reportviewers toolbar. i know this is possible.. but can someone pleeeease give me a hand! P.S: and by the way is it possible in both rdl and rdlc or just rdlc Thanks Egli ...Show All
