Todd H.'s Q&A profile
Visual C++ C++/CLI code porting problem
I'm trying to port a C++.NET (managed extensions) application to C++/CLI. However I'm not very strong with the syntax yet. What I'm trying to do is to create a wrapper for a C Dll file. To do this I'm using DllImport but I failed to found documentation on it's use. There are some problems due to changes of the syntax but I couldn't find out why yet. The C++.NET line looks like this: [DllImport("my.dll", CharSet = Ansi, CallingConvention = Cdecl, EntryPoint = "#10")] static MY_STATUS CPPInit(MY_HANDLE *pLmxHandle); The idea is to pass a reference of MY_HANDLE to the function which initializes it. One problem is that the key ...Show All
SQL Server Can't get SQL Manager to connect to server instance SQLEXPRESS
I installed SQL Server Express and SQL Server manager, then tried to start manager. SQL Service is running, but SQL Manager attempt to connect to SQL Server instance times-out even though I correctly identify instance as SQLEXPRESS Everything seems to be normal - both SQL Server and Manager are on a single Windows XP home machine. Any suggestions. Thanks Hi, There are only two datatypes that could handle date and time values in sqlserver. These are DateTime and SmallDateTime . Both of these types cold not handle data between 1/1/0001 to 31/12/9999. But you can store these dates as a varchar and just pa ...Show All
Visual C# How to determine week no. of a given date?
For example I have a list of dates 5/11/2006, 5/18/2006, 5/25/2006 How can I categorize these dates sample output: Today: 5/25/2006 Last Week: 5/18/2006 for Today,compare with DaysOfYear for Date.Now with DayeOfYear of the passed Date.Time and if 0,then today Use this method to categorize weeks- First time pass DateTime.Now - get week Next time pass the date to determine-get week (if 1 then last week) public static int GetWeek ( DateTime t) { int dayOfYear = t.DayOfYear; double week = Math .Floor(dayOfYear / 7.0)+1; return ( int )week; } ...Show All
.NET Development Efficient code for connecting to SQL, advice please
Hi, I have an application which is similar to the following example Private Sub Start() For a as int16 = 1 to 300 lstResults.items.add(GetPriceFromItem(a)) Next End Sub Private Function GetPriceFromItem(byval item as int16) as String 'Connect to SQL 'Execute "SELECT Price FROM Table WHERE Item='" & item.tostring & "'" 'Close Database connection 'Return Price End Function I want to know if there is a more efficeint way of doing this, i.e. i'm concerned that the routine creates 300 SqlConnection instances, 300 open/closes and 300 queries Would a better way be to connect to SQL once, get the entire tab ...Show All
Visual Studio Team System removing autogenerated solution files from source control
Not sure which is the best forum for this question. I'm trying to find a way to prevent certain files (.vsmdi and .testrunconfig to be exact) from being stored in source control. I want the solution (.sln) and projects, etc. to be in source control, but I don't want the vsmdi and testrunconfig files checked in and out everytime someone makes a change on their local machine. Here's the user scenario that's causing me problems: - user A gets latest version of a test project in the Solution. - user A goes to test manager and runs a test. - the vsmdi file is automatically checked out because the run ID (GUID) changes. - user B get ...Show All
Visual Studio Team System Coverage Information
Hi, I have read about the code coverage tool available in the Visual Studio Team Edition. It seems, please correct me if I am wrong, that we actually need to write codes to test the targeted application in order to get the coverage information. My question is that is it possible to get the code coverage information if we test the ASP.NET application directly from the web/UI My plan is to have a "profiled" ASP.NET application so that when a tester tests the application from the UI the profiler will collect the coverage information. Thank you beforehand. Buhi One ...Show All
SQL Server Native Client connection to MSSQL 2000
For MARS support in SQL Server 2005, I'm changing our OLE DB code to use Native Client. My understanding is that Native Client should support SQL Server 2000 as well. When I point my DBPROP_INIT_DATASOURCE to a 2005 instance, everything works great. But when I point to a 2000 instance, the IDBInitialize->Initialize() call is crashing with a bounds violation. In my test case, the only change I made was in my coCreateInstance from this: ::CoCreateInstance(DBIO_CLSID_SQLOLEDB, NULL, CLSCTX_INPROC_SERVER, IID_IDBInitialize, ( void **)&m_handles.pIDBInitialize); to this: ::CoCreateInstance(CLSID_SQLNCLI, NULL, CLSCTX_I ...Show All
.NET Development List files on ftp server
Hello all, i have created an ftp client in C# using Wininet and i am able to download upload files from and to my ftp server, what i would like is to have the list of files and directories on the ftp server using wininet. any help would be great. With WinInet you'll have to PInvoke FtpFindFirstFile and InternetFindNextFile . Just FYI: there is an FtpWebRequest class in 2.0 that can make some operations easier, but doesn't actually provide as detailed an API as WinInet. ...Show All
.NET Development Webservice SSL issue
I have a secure webservice that uses SSL (and basic authentication). I also have a client application that calls functions on this secure web service. We get an error " Could not establish secure channel for SSL/TLS". We have tried all the suggestions on the net and have finally run out of options. Has anyone else had this problem This problem happens sporadically on some machines, and on others it happens with every single call. The function I am testing is called "CheckConnection" and simply returns a 1. I am passing all of the logon credentials. Like I said, on some machines this error never comes up.& ...Show All
SQL Server Parameters
SELECT CodiceCliente, RagioneSociale, Articolo, Comma, descrizione, Area, dtDeroga, dtFineDeroga, SuContratto, Parametri FROM MasterDeroghe WHERE Articolo = ( CodArt) I want to pass a parameter at a report of reporting services with this query but this query don't conceid it. why what's wrong My database is access If CodArt is supposed to be your parameter, that is your problem. Report server parameter variables start with @, i.e. @CodArt ...Show All
SQL Server I can't show a calculated member
I need to show a calculated member in a report. Reports works fine with calculated measures, but when you try to use a calculated member then raises an error which says The following system error ocurred. Invalid procedure call or argument. Any ideas Can I use calculated members I'm using RS 2005 April CTP. Thanks in advance. Thanks Chris, that was quite helpful. I wish there was a way to instruct the query builder to avoid subqueries. I am finding their limitations to overwhelm their value. ...Show All
SQL Server How to connect to sql server2005 from java using JDBC driver
Hi, everyone: I need to connect my java app to sql server 2005 using JDBC driver, but I don't know how to do. Thanks for your help. Adolfo We currently have a beta2 driver availalbe for this now: http://www.microsoft.com/sql/downloads/2005/jdbc.mspx To connect: Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); Connection conn = DriverManager.getConnection("jdbc:sqlserver://mysqlserver;user=myuser;password=mypassword;databaseName=mydataBase;"); ...Show All
SQL Server SSMS-EE: Creating and Using Stored Procedures - Error Messages 111, 156, & 102
Hi all, I tried to use the SSMS-EE Query to execute the following code statements: --- SQLQuery.sql--- USE testDB DECLARE @procID int DECLARE @procName varchar ( 20 ) DECLARE @procType varchar ( 20 ) CREATE PROC sp_getRecords AS SELECT * FROM Inventory CREATE PROC sp_insertRecord @procID int , @procName varchar ( 20 ), @procType varchar ( 20 ) AS INSERT INTO Inventory VALUES ( @procID , @procName , @procType ) CREATE PROC sp_deleteRecord @procID int AS DELETE FROM Inventory WHERE ID = @procID CREATE PROC sp_updateRecord @procID int , @procName varchar ( 20 ), @procType varchar ( ...Show All
Visual Studio Express Editions UserDeletingRow in Datagridview
Ok here is my issue, I have my datagridview bound to my DB, but when I go to delete a row the row disappears from the datagridview, but when I go into the backkend of the DB the data is still there. Here is the code, any help is apperciated. I am quite new to VB, so I am still learning thsi stuff. Private Sub DataGridView1_UserDeletingRow( ByVal sender As Object , ByVal e As System.Windows.Forms.DataGridViewRowCancelEventArgs) Handles dgrWirelessView.UserDeletingRow If MessageBox.Show( "Are you sure " , "Delete Row" , MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.No Then e.Cancel = ...Show All
.NET Development .NET Application crashes
In the sample code , show below, we are merging many binary file to a single mp3 file. This process works fine for 4 times , but on the 5th time, the application crashes on br.Read without throwing any .net error. We have implemented try catch blocks also.It gives the system error &H80131315& Dim fsInput As System.IO.FileStream Dim fsOutput As System.IO.FileStream Dim bw As BinaryWriter Dim br As BinaryReader Dim sMergeFiles() As String Dim iCount As Short Dim bytBuffer() As Byte = New Byte () {} Dim lFileSize As Long Dim sMergedFile As String ...Show All
