jbassmanp's Q&A profile
.NET Development Open SQLConnection in Exclusive Mode
Hi, I've an application that when run for the first time needs to know if the SQLServer database is in use already by another user. In ADO I use the following command: try Db.close Db.Mode = ADODB.ConnectModeEnum.adModeShareExclusive db.open ConnectString Catch ex as Exception Db.Mode = ADODB.ConnectModeEnum.adModeUnknown End Try If Db.Mode = ADODB.ConnectModeEnum.adModeShareExclusive Then 'Is exclusive ..do stuff endif How can I achieve this in ADO.NET Thanks in advance. Joao ...Show All
.NET Development Can't save multiple authors to topic
Can't save multiple authors to topic I have a listbox with some authors in it. Its multiselect property is set to simple. When I select more than one author and click save, the first author is properly saved in the TopicAuthorAssignments Table. However, I then get the following error. Type = System.Data.Oledb.leDbException Message = The changes you requested to the table were not successful because they would create duplicate values in the index,primary key, or relationnship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again. ...Show All
.NET Development Convert Untyped Dataset to Typed Dataset
I am using the Enterprise Library which returns untyped dataset. I have a typed dataset that was generated from the same stored procedure that the enterprise library calls. I need to convert the untyped dataset that I am getting into a typed dataset that will be utilized by the presentation layer. I tried using DataSet.Merge but it just adds the untyped table into the typed dataset as a second table. How can I make this work Thanks, Steve Hi! You need to cast it to the typed dataset like as follow: TypedDataSet myTypedDataSet = (TypedDataSet)GetUntypedDataSet(); Where myTypedDataSet is variable of TypedDataSet and GetUntype ...Show All
SQL Server having a contractor develop SSIS packages and security issues
Hi Guys, I will have a constractor for 3 months developing ssis packages for me. Obviously, his Windows account will be deleted when he leaves. My question his. under which securoty context should he develop packages so they will still work and still be accessible after his departure. Assuming we do not want to use any password to either have his packages running or have his packages accessible by other developers from the development environment. Most of all we do not want ANY job failure due to "encryption issues" after his departure Thanks Philippe If you store your packages t ...Show All
Visual Studio Express Editions starting another application with parameters
Hi there.. i want to start an application which name and path is stored in my.settings. so i use Process.Start(My.Settings.pfadname) when i execute my program and the filename in my.settings contains any command-line-parameters, vb tells me that the file doesnt exist.. so how can i make the programm start any other app using parameters Greetings Jan "JeriC" Eric Protected Sub CreateProcess( ByRef Filespec As string, ByRef Switches As string) Dim startinfo As New System.Diagnostics.ProcessStartInfo Dim Proc As New System.Diagnostics.Process startinfo.FileName = FileSpec ...Show All
Visual Studio Express Editions C# Callback from C++ DLL
I have created the following DLL in VC++ Express: #pragma data_seg( "SharedBlock" ) HHOOK hookCbt = NULL; int pcount = 0; #pragma data_seg( ) _declspec( dllexport ) LRESULT CALLBACK InternalCbtHookCallback( int nCode, WPARAM wParam, LPARAM lParam ); // Nonshared variables HINSTANCE g_hInstance = NULL; BOOL APIENTRY DllMain( HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved ) { if ( dwReason == DLL_PROCESS_ATTACH ) { if( pcount == 0 ) { // Init g_hInstance = hInstance; } pcount++; } else if ( dwReason == DLL_PROCESS_DETACH ) { if( pcount == 1 ) { // Free } pcount--; } ...Show All
Visual Studio Team System Each rows in different color in VSTS can this be done?
I'm just curious, in addition to sorting columns, can we make each rows in a different color When viewing the All Bugs list, wouldn't it be nice to quickly identify the P0/S0 bugs from the entire list with the row being in a different color and have some sort of legend Food for thoughts! Thanks Vince Unfortunately in V1 this isn't possible, but it's a great idea for vNext. I will make sure this idea gets jotted down. By the way, the control that displays the result list is public (WorkItemResultGrid). If you were to create your own WinForms application that displayed WorkItems, you could subc ...Show All
Smart Device Development Device Emulator Preview & NAT connectivity question...
I'm running the Device Emulator Preview with a Windows Mobile 5 image. I enable networking and it binds to my adapter with no issue. I'm able to connect to resources on my home network (DHCP issues the device an IP address). Example, I can connect to http://server , which is a server on my network. However, when I attempt to connect to www.cnn.com or anything outside my network, it won't connect and says I need to setup my network connection. I've even tried setting a static IP to make sure the default gateway is getting in there (it's issued via DHCP) but that's not the issue. I'm curious as to why the adapter that the emulator ...Show All
Windows Forms NetworkStream and StreamReader/StreamWriter
I've got an app that uses the TcpListener and TcpClient classes to accept a connection and assign it to a NetworkStream which is then assigned to a StreamReader and StreamWriter. The program uses a Do Loop to read data from the stream as it becomes available. This all works great. The problem comes when the connection is lost. I need ...Show All
Visual Studio the need for an IIS? please help
I am new to visual basic.net and i have some questions that i need to answer first before installing vstudio. Is Apache web server compatible <as a replacement for IIS> for Visual Studio Will it Work for VStudio Web apps <asp particularly> If it does, are there any additional configs And the other one is the database compatibility. Can mySql work with VB.net what are the configurations or settings <i am currently using Apache,mySql and php on a single pc and want to install VisualStudio.net> No, I don't think so. VB2005 has it's own web server built in, however. There is an entire website dedicated to peop ...Show All
Windows Forms to set timer while playing audio
I am using windows media player in my application..and want to show user how much time has elapsed since sound started playing. Hi, Where would you like to show please give us more details... Thank you, Bhanu. ...Show All
Visual Studio Team System Changing Permissions on New Branches
Hi, I am working on a project to migrate from a custom version control system to Team System and I am currently investigating auditing possibilities. One preposed method is to have developers branch from the current project baseline, work in the new branch and then have an auditor merge the changes from the new branch to the baseline. The problem with this is that developers do not have checkin privileges on the project's baseline so when the baseline is branched, they cannot checkin code on the new branch. Is there a way to automatically change the privileges on this new branch to allow developers to checkin code Or is there a way to all ...Show All
SQL Server [OLE DB] how to use CCommand::Excute()...
i want to set up a rowset with CCommand<CDynamicAccessor>::Execute(), but the CCommand do not provide me any function to set the CommandText. is it the only way the i must do with the ICommandText interface myself i tried to use ICommandText::SetCommandText to set up this command, select * from authors where state=@state , and it returns S_OK. then i tried to use ICommand::SetParameterInfo to set the parameter info, and it also passed. to use Execute(), a DBPARAMS* is required to pass in the values of parameter, i use the following code to set the DBPARAMS::hAccessor, but failed struct Param{ PWSTR state; }; ...Show All
Visual Studio Express Editions Printing data
I have downloaded the free version of Visual Basic 2005 Express Edition from MS, previously I used Delphi. I can build a database, using a datagridview to display records, but there is no Report tool to do any data printing with. There are some net tools ie Print Preview control, Print Document etc but nothing like a Report function. How can I print off my data How to: Complete Windows Forms Print Jobs ms-help://MS.VSExpressCC.v80/MS.NETFramework.v20.en/dv_fxmancli/html/23ec74f7-34c5-4710-82a0-ee2914518548.htm How to: Create Standard Windows Forms Print Jobs ms-help://MS.VSExpressCC.v80/MS.NETFr ...Show All
.NET Development array redim and redim preserve
Greetings All, The following is the vb.net code i need equilant C# code. can anybody pls help me to complete the following Dim vaResultSet If Not IsArray(vaResultSet) Then ReDim vaResultSet(0) Else ReDim Preserve vaResultSet(UBound(vaResultSet) + 1) End If Thanks in advance sai Sadly, Microsoft were forced to preserve a lot of VB6 *** in VB.NET. Read this link: http://www.aspheute.com/english/20001025.asp and then consider throwing this rubbish away in favour of a proper dynamic array. ...Show All
