Mohamed B.'s Q&A profile
SQL Server Creating a new links server to MS ACCESS DB
How do you create a link to MS Access DB in SQL Server 2005. Thanks Hi, sorry I am new at this. Where do you enter this information Disregard the above. I used this query from support, and it worked wonderfully: sp_addlinkedserver 'Nwind', 'Access', 'Microsoft.Jet.OLEDB.4.0', 'E:\DatabaseLocation\test.mdb' ...Show All
Visual Basic Getting textbox text from another form (vb 2005)
Does anyone know of a simple code to put text from a textbox in one form into a textbox on another form. I would like to do this when a button is pushed. It was easy in vb6 but I am using 2005 now. All I had to do was write "textbox1.text = form1.textbox1.text Yes, you are right. I think too, that using default instances is bad programmers habit. I see it in application written by my precedessors. They used global variables and default instances and it is very hard to find, when variables are set and when forms are created and destroyed. Default instances were removed from VB.NET 2002 and 2003. And I think they were introduced to VB.NET 2005 only to easy convert VB 6.0 projects to V ...Show All
Windows Forms How to find the window handle which window proc is subclassed
I try to find the window handle of edit box in calculator. But failed.... I see from spy++, that the window proc of edit box is subclassed, i guess that may be the reason why I can't get the window handle. Because i can get all the other windows in calculator. My code is: [ DllImport ( "user32.dll" )] public static extern int FindWindow( string lpClassName, // class name string lpWindowName // window name ); [ DllImport ( "user32.dll" )] static extern int FindWindowEx( int hwndParent, int hwndChildAfter, string lpszClass, string lpszWindow); public static void Main() { int hwnd=0; int hwndChild=0; int hwndChild1 = 0; ...Show All
SQL Server MDX Newbie : Average Population Size
SQL 2005 SSAS I have a table of daily population of vessels by category. (We're a shipping company so population is number of vessels, but the MDX could equally apply to any population). I need to get the MDX to give average population size over a period and category. Total population was easy : it's just COUNT DISTINCT vesselname. But average needs to be something like : (COUNT DISTINCT DAILY vesselname for given category) averaged over the time period. Can anybody point me in the right direction to get the MDX for this Thanks Heres' a sample Adventure Works query which computes the average daily customer count for various product categories, in Q4 2003 ([Measures].[Customer Count] is a d ...Show All
Visual C# Interfaces oversold???
First, I must admit that I am a C# novice and so I probably don’t have as much knowledge and experience on the subject of interface as most of you guys reading this post. After reading a few books on C# and interface design, I still can’t see and understand the real power of interface unless of course, we are talking about interfaces as a powerful concept in OOP ‘only’ and not as a powerful concept in the general sense. When I was first learning OOP I was quite suspicious about the ‘excellent features’ that OOP claims to be able to deliver to the world and I was right. For example, in reality OOP offers very little if any, code reuse. I am now having the same suspicion about interfaces even though I see a lot nice words used to d ...Show All
Visual Studio Team System Anyone using TestToolsTask-1.1 ?
TestToolsTask-1.1 is the new task that Buck Hodges posted to allow test running without owning the VS test version. I am having some problems with it. I have replaced the Original TeamFoundation targets and also added the PowerToys assembly to the PrivateAssemblies folder. I have the following set with the .proj file: < RunTest > true </ RunTest > And then I have the following: <MetaDataFile Include=" "> <TestList> </TestList> </MetaDataFile> --> < TestContainerInOutput Include = " %2a%2a\%2aTest.dll " /> Since I have everything configured correctly I am not sure why my tests aren't being run. I assume TestContainerInOutput is suppose to fin ...Show All
Windows Forms Toolbar Button Images Not Appearing in Run Mode
I'm building a simple C# WinForms app that has a toolbar at the top. I've made each of the buttons fairly large: 130 x 32 so that I can include text and an image. The images are being drawn from an ImageList control In Design mode everything looks perfect, but when I run it the images disappear from the buttons! Any ideas why this is happening Robert W. Vancouver, BC If you ever figure this out, the same thing is happening to me. It's a WinForms 1.1 app with 1 main toolbar and another toolbar on a child-form. The problem happens randomly, where just none of the icons show up on either toolbar. If I restart the app a couple of times, they may show up. Roger Dickey, Jr. Amelia Island, FL http://w ...Show All
SQL Server Encryption and query performance
I am trying to implement encryption but have run into some serious performance issues. I am required to encrypt the SSN in our database. In and of itself, this is not a problem. The problem comes in because there is also a need to be able to query the table based on the SSN. Since the SSN is encrypted, the query basically performs an index scan, decrypting each value as it goes along. As a result, the query for one record out of 10 million records in the table takes three minutes. It needs to occur immediately. If I could encrypt my SSN parameter and then compare it to the encrypted value in the column, it would work fine. Unfortunately, everytime you encrypt a particular value, the resultant encrypted value is different. Hence, I have ...Show All
Windows Forms Why My Custom ToolboxItem did not work?
public class ActivityToolboxItem:ToolboxItem { //private Type m_Type = null; public ActivityToolboxItem() { } public ActivityToolboxItem(Type pComponentType) :base(pComponentType) { //this.m_Type = pComponentType; } public override string ComponentType { get { return base.ComponentType; } } } and then in IToolboxUser Implementation. public bool GetToolSupported(ToolboxItem tool) { if(tool.TypeName == "WindowsApplication5.MyActivityA") { return true; /// } return false; } the "WindowsApplication5.MyActivityA" class is decorated with ToolboxItemAt ...Show All
SQL Server Creating Job to do Daily Backup
I have a client that is using the free MSDE database engine. There is no graphical interface that I know of to manage the day-to-day tasks. I need to do a daily backup to a disk file. I want to start the backup at 7:40pm. My client then will copy that disk file to tape duing his system-wide backup at midnight. I setup a batch file and executed it in osql but the job is not working. No disk file has been created in the last 3 weeks. I don't have a clue what I am missing. Can someone please look at this and tell me how to fix it Thanks in Advance! Debbie Erickson USE master EXEC msdb..sp_delete_jobserver @job_name='PetDB Backup', @server_name='Server06' GO USE master EXEC msdb..sp_delete_jobschedule @job_name='PetDB Backup', ...Show All
Visual Basic Save data from a listbox to a .CSV file.
Hi, I am pretty new to Visual Studio, but know enough about SQL. I am working on creating some applications with VB to access my SQL database. I created a listbox that is extracting some data from a table. I am trying to Save that data to a .CSV file, but I am having major issues. I would really appretiate it if someone could help me and explain why my code is not working. I used examples to get to this code, but lack of experience is helping me to get stuck at this point. Thanks!!! Code: Try With sdlgTextFile .AddExtension = True .CheckPathExists = True .CreatePrompt = False .OverwritePrompt = True .ValidateNames = True .ShowHelp = True .DefaultExt = "txt" .FileName = filename .Filter = _ "CSV Fil ...Show All
Visual Basic Manner to retrieve total amount of memory used by a launched process & it's children?
I've written an app that launches a .exe file as a synchronous process and monitors it's processID while waiting in a loop. While in that loop, I can check the stats of the .exe's process, returning info I need such as the maximum amount of memory that was used over the course of it's "run". However, I've noticed that the Process Class properties (.PeakVirtualMemorySize64, .PeakWorkingSet and others) only report the memory used by the .exe (root process) itself--they do *not* take into account any memory used by any child processes that the .exe might utilize. Since the Process class does not contain a "childProcesses"-type collection, I am unable to recursively loop below the level of the parent exe process and get a t ...Show All
Smart Device Development Application does not run if the GPRS is activated
hi all, I am having the application that simply fetches the site contents and display it on the form. But i m getting error "PROTOCOL ERROR". i dnt knw whats wrong with it. its a simple code of requesting and responsing. thts all. nothing else. Plz help. Coz i m not able to run my main application also. thanx in advance. hi, I m getting different types of errors. Now i m getting SendFailure error also. Also SocketException raised. Plz any1 for help. ...Show All
SQL Server Replication fails when table name has single hyphen
Hey, I have SQL Server 2000 DB that was converted via DTS from Acccess 97. Replication fails for any table with a single hypen in the table name. If I copy one of these tables to a name using an underscore rather than a hyphen, then it replicates successfully. Below are errror messags from agent with -Outputverboselevel set to 2. I have also seen 'Agent error code 20082', in which case the replication command is incomplete. Any ideas Thanks, Bill Coulter [12/7/2006 1:22:40 PM]172.23.150.51.engdata: {CALL sp_MSupd_br1-16 (NULL, ,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, ,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, ,0x0200020000)} Parameterized values fo ...Show All
Visual Studio 2008 (Pre-release) resize ListView header column.
How can I fix the size of ListView header column so it will be not possible to resize it Thanks in advance here is one way to do http://blogs.msdn.com/atc_avalon_team/archive/2006/04/11/573037.aspx ...Show All
