kiko38's Q&A profile
SQL Server storedproc return
for some reason i keep getting a exception heres the code for the app int returnvalue = 0; DateTime dateCreated = DateTime.Now; // All users are added to Guests role upon registration. Roles.AddUserToRole(username, "Users"); String connectionString = ConfigurationManager.ConnectionStrings["SqlConn"].ConnectionString; SqlConnection conn = new SqlConnection(connectionString); SqlCommand command = null; try { conn.Open(); command = new SqlCommand("InsertMember", conn); command.CommandType = CommandType.StoredProcedure; command.Parameters.Add(new SqlParameter("@AspNetUsername", username)); command.Parameters.Add(new S ...Show All
Visual Basic FileSystemWatcher in arraylist
Hi all, I'm trying to monitor changes in a number of folders using FileSystemWatcher. I have a procedure that accepts the path to monitor. A new FileSystemWatcher is created for that path, together with its event handlers, and added to an arraylist (watchList). This seems to work fine, however I would like to be able to modify the attributes of specific watchers at run-time. I'm doing something like this to stop the first watcher in the arraylist: Dim w As FileSystemWatcher w = watchList.Item(0) w.EnableRaisingEvents = False This causes a NullReferenceException at the last line. In break mode I see the arraylist has 3 elements of type Object, but adding a watch for watchList.Item(0).path (or any other watcher pro ...Show All
Visual Studio Express Editions Start help with threading
I’m new to c# and struggling to get the code right to run the “ HttpBetFairAccountSnapshotResponse response = request.GetResponse();” as a background thread. Can anyone point me in the right direction HttpBetFairAccountSnapshotRequest request = new HttpBetFairAccountSnapshotRequest (); request.Method = "Get" ; request.Account = defaultAccount; //Execute the request and get the response HttpBetFairAccountSnapshotResponse response = request.GetResponse(); if ( response.BetfairBalance != null ) { localbetfairAvailableBalance = response.BetfairBalance; StringBuilder builder = ...Show All
Software Development for Windows Vista RegOpenKeyEx() Unable to find key?
Under vista keys my app writes goes into HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node vs the old HKEY_LOCAL_MACHINE\SOFTWARE\ on XP. When I read using RegOpenKeyEx() I get an error 2 key not found returned. How do I determine when or how to look for a key when on a 64 bit machine running Vista Thanks. Hello Sir, I have attempted to duplicate your issue however I am not seeing the results that you are getting. Can you please provide me with the following information: What build of Vista are you running Have you tried running the application with a compatiblity shim applied Have you tried running your application in an elevated user context And does the problem duplicate Have you tried using other re ...Show All
SQL Server SQL 2005 Client Tools
I have to deploy the Client Tools to a dozen or so computers on our network. We currently use SMS to deploy our software and the intention is to use this to deploy the client tools. Can anyone advise on the best way to do this Thanks ...Show All
Visual Basic Simple problem with Combobox in Datagridview
Hello, I have a datagridview set to a datasource that fires up just fine. When I go to change one of the columns to a combobox type, all I get are exceptions. I have the DataPropertyName set to the correct field and would like the user to be able able to select from a simple list 1-30 - which I then put in the Items (collection) area. I have left the DataSource/DisplayMember/ValueMember all blank since I am providing the dropdown data. What am I doing wrong Does the following comment have something to do with it What does the following mean The drop-down list values (or the values indicated by the ValueMember property) must include the actual cell values or the DataGridView control will throw an exception. Thank yo ...Show All
SQL Server Next Measure
Lets say I have a set of measures that go like this: Date, Payment October 3, $3 October 6, $4 December 6, $5 December 8, $4 My problem is that I need to get the next payment date and amount. So if for example I am standing in October 3, I would have to get (October 4, $4). If I was standing in october I would have to get (December, $9). Assuming I have a measure called [Payment] and a [Date] dimension ([Year], [Month], [Day]), How can I do this with MDX Thanks in advance There are two ways to do it, one is recursive and another one is not. It is hard to judge which one will perform better, both of them have their problems: 1. CREATE NextPayment = IIF(IsEmpty(Time.NextMember) A ...Show All
SQL Server Question about user management
Good evening, I have to admit that I've just started using Reporting Services. I've just managed to intall it on a Windows 2003 Server, running SQL Server 2005 Developer Edition. The first issue I've noticed after installation is associated with the ability to manage the users that have access to the reporting services, as well as what roles they are associated with. After a bit I figured that reporting services was using Windows Users. That's not much of a problem in my situation, although I'd prefer if it was something more like ASP.NET 2 Membership and Roles. Nevertheless, eventhough I've managed to find this one out I didn't seem to find a way to manage the permissions of the users. Could someone help me out on this one ...Show All
Windows Forms How can I override the default Text when extending a toolbar in VS 2003 version?
I wanted to extend the toolbarbuttons with mytoolbarbutton. How can I override the default Text when extending a toolbar in VS 2003 version Here is the sample I wrote (I know this is very awkward workaround) and wanted to make it proper. public __gc class MyToolBarButton : public ToolBarButton { private: String* _title; public: MyToolBarButton() : ToolBarButton() { ... } __property String* get_Title() { return this->_title; } __property void set_Title(String* value) { this->_title = value; this->Text = this->_title; } } Instead of get_Title and set_Title, I want to use get_Text and set_Text (or whatever way to override the default text property) like this. ...Show All
.NET Development Get list of tables in ACCESS using VB.Net app
I am using Visual Studio 2005 (VB.NET). My app. is using an Access db in the background. Once connected to the DB, I want to display a list of all the tables in a combobox on one of the forms. How do I go about doing this Thanks Nihal, thanks your code seems to be working well, except for the error message below: "More restrictions were provided than the requested schema ('Tables') supports." If I take the restrictions out, the code works, but all tables are displayed, which I don't want. Any idea how I would fix it ...Show All
.NET Development How to Close Connection When Using Data Reader
In a Windows app, C#, VS 2005 I have a generic class which opens and returns a data reader to the calling class where the data is processed. The generic class, get DataReader, opens a connection and generates the reader as follows: cn = new SqlConnection(strConn); cmd = new SqlCommand(strSQL, cn); cn.Open(); dr = cmd.ExecuteReader(CommandBehavior.CloseConnection); In the calling class, after the data is processed, I have no way to close the connection cn, and the CommandBehavior.CloseConnection parameter does not seem to close it either. I have Max Pool Size = 3 in the connection string, and I get a timout error when I try to open the data reader the fourth time. The calling class's code is: dr = sqlClass.getDataReader(strSQL); ...Show All
.NET Development Create sourcecode from a WSDL
Hi I want to consume a web services. When I ran svcutil against the wsdl I got the following error: ------------------------------------------------------------------------------- Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin>SvcUtil.exe /ser:Auto n:\ECC_CU STOMER002QR.wsdl Microsoft (R) Service Model Metadata Tool [Microsoft (R) Windows (R) Communication Foundation, Version 3.0.4506.30] Copyright (c) Microsoft Corporation. All rights reserved. Error: Cannot import wsdl:portType Detail: An exception was thrown while running a WSDL import extension: System.Se rviceModel.Description.DataContractSerializerMessageContractImporter Error: Object referen ...Show All
SQL Server Script Component Task: function that returns last word in a string
I have a field called CustomerName Varchar 100 and I wish to write a function that can do the following in a script component task create a function called CleanString (ByVal CustomerName as String) As String CleanString Returns the last word of a Customer name if the CustomerName field contains more than one word or if the CustomerName field does not contain Corp or Ltd ie parse 'Mr John Tools' and the function returns 'Tools' ie parse 'TechnicalBooks' and the function returns 'TechnicalBooks' ie parse 'Microsoft Corp' return 'Microsoft Corp' ie parse 'Digidesign Ltd' return 'Digidesign Ltd' Any idea of a regular expression or existing piece of existing code I can have thanks in advance dave ...Show All
Windows Forms STA and threadpool problem
Hello, I have a Windows Form project which i tried to merge with a console project that uses Thread pool. After i did that i got a messege saying: "WaitAll for multiple handles on a STA thread is not supported." OMG someone please help me! this is an emergency beucase i must use the ThreadPool. anyone has an idea Your question has nothing to do with the original thread topic, you need to start a new thread. ...Show All
.NET Development How to Console.WriteLine (SqlConnection.GetSchema) ??
My end goal is to find out if a particular table exists in Sql Server database . I tried a few tricks with dismal result and finally stumbled on GetSchema method. I thought it would give me all the information I need. The problem is I cannot get it exposed for review: SqlConnection connHist = new SqlConnection ( "server=ddmnvt61\\sqlexpress;" + "database=hist_Tick;Trusted_Connection=Yes" ); connHist.Open ( ); DataTable sqlDt1 = connHist.GetSchema ( ); for ( int ii = 0; ii <= sqlDt1.Rows.Count; ii++ ) { for (int jj = 0; jj <= sqlDt1.Columns.Count-1; jj++) { Console.WriteLine (" {0}", sqlDt1.Columns[jj].DataType ); } ...Show All
