Peter Peter's Q&A profile
Visual Basic Shut Down PC
Is there a way to shut down a PC using the framenetwork I tried the "shutdown /s" command but the shell doesn't work on my PC. Thanks. there isnt a class that does this in the .NET Framework but using the shutdown command will work, if your OS supports the shutdown command (Windows 2000, Windows Server 2003, XP and Vista). The correct way of doing so if you have the above: Dim thePSI as new System.Diagnostics.ProcessStartInfo("shutdown.exe") thePSI.Arguments = "/m \\ computerName /s /t 10" System.Diagnostics.Process.Start(thePSI) does this not work for you If it works, it should shutdown the computer after 10 seconds alternatively you could ...Show All
Windows Forms Drag and Drop problem(I have the code thoe)
Hey, For the image drag and drop stuff I ahve a little problem...I want it to drag and drop but I dont want it to totaly take the image out...So what I am trying to do is instead of making it so that when you drag and drop an image it goes that but the picturebox that you draged the image from will still have it's image in there...Here is the code: private void pictureBox2_DragDrop( object sender, DragEventArgs e) { // Display the image in the selected PictureBox control. PictureBox pic = (( PictureBox )(sender)); pic.Image = (( Bitmap )(e.Data.GetData( DataFormats .Bitmap))); if ((e.KeyState & CtrlMask) != CtrlMask) { if (sender == pictureBox1) { pictureBox2.Image = null ; } else ...Show All
SQL Server sql data source error
when going through the data source configuration wizard i am having a problem. when the wizard asks "which database object do u want in your database i get this error An error occurred while retrieving the information from the databse: Failed to retrieve data for this request. Could not continue scan with NOLOCK due to data movement Can someone help me with this error im doing this throught he tutorials that came with the express Edition download and i am stuck at this point. i have done some vb6 and want to refresh my self with the diffrences in express The error is raised if your underlying data is changed during the execution of nolock query. This is the drawback for using nolock (i.e. ...Show All
Visual Studio 2008 (Pre-release) How to Bind to an ADO.NET Data Source.
somebody knows as to connect data of a table of data base to one grilla How to Bind to an ADO.NET Data Source. this is what I have done: Imports System.Data Imports System.Data.OracleClient Public Class Form1 Dim Cnn As New OracleConnection( "Data Source=SOURCE;User ID=Iili;password = lili; Unicode=True" ) Dim DataAdapter As New OracleDataAdapter( "SELECT * FROM GE_SEG_ROLE" , Cnn) Dim DataSet As New DataSet Private Sub Load( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase .Load DataAdapter.Fill(DataSet, "GE_SEG_ROLE" ) End Sub In the XAML file this it is code: < Window x:Class = " Window1 ...Show All
Game Technologies: DirectX, XNA, XACT, etc. How do i turn off anti-aliasing?
I know this is an easy answer but i just cant find it. I remember something about being able to set a property in beta1 with the graphics designer. I was looking all over in beta2 and i cant find it. thanks in advanced. Thank you for your response. As a last request i would like to know where i have to add this. I'm guessing in the initialize section so i'll try that for now. ...Show All
Visual Studio Too much network I/O
Hi All... I'm running Visual Studio with Sourcesafe 6.0. I've just loaded a project from sourcesafe. When I go into Windows Explorer and browser to where the project is stored, it looks like all the files are there. But when I try and open the web.config file from the solution explorer, the network traffic goes through the ceiling and the Studio pretty much just hangs. I'm working remotely from the sourcesafe database so I'm sure that doesnt help. I've also implemented some of the tricks found on the web like specifying temps files to be local - to make sourcesafe run faster. It runs fine on another machine thats still running dev studio 6.0.... So what's it doing with all this network I/O Thanks! -- Curt ...Show All
.NET Development OleDbCommand.ExecuteNonQuery not saving a new row in MS Access db
Hi, I'm writing a Windows forms app in C# using OleDbCommand and a stored procedure (an AppendQuery) in an Access DB. The command object returns a '1' to show a row has been updated/ inserted. But when I look at my table in the db, the new row isn't there. Please help! I'm working with a test example: my Access db has one table (Regions) with two fields: 1- region_id AutoNumber primary key 2 - region VarChar(50) [nulls OK] ... then a stored procedure called NewRegion: INSERT INTO Regions (region) VALUES ([ ]) note: I've tried ' ' and @REGION parameter names, both with unsuccessful results. Sample code: in an event handler: OleDbCommand insertCommand = new OleDbCommand("NewRegion", getConnection()); insertComma ...Show All
Visual C++ Cl.exe / link.exe / lib.exe: Need help with command line opts
Hi, I'm working on an MSBuild setup for compiling for both desktop and WCE devices. Got everything installed, but here's the observation and question: All of the tools are named the same (i.e. compiler is cl.exe, linker is link.exe, etc.) What (in as much detail as possible, msdn help doesn't cover very well) does the /MACHINE option do Can I use the desktop compiler (located in Visual Studio 8\VC\bin) to compile for CE devices by throwing the /MACHINE:ARM switch Am I required to use the /MACHINE:ARM switch when compiling/linking from the link.exe located in the CE directory Am I required to use the cl.exe found in "Visual Studio 8\VC\ce\bin\x86_armv4i" Is there a difference When using the linkers (same ...Show All
Visual Studio Express Editions Porting web navigator from VB6 to VS2005 C#
I am porting a VB 6.0 application to C# that automates navigation of multiple web pages within a site and extracts information from some of the pages. One of the pages contains a listbox containing a number of countries. The default value that is set is not the value I need to use. The HTML in the web page looks like this: <select name="country" style="" onchange="" multiple id="countryList" size="7"> <option value="*" selected> All Countries and Territories </option> <option value="------0">------</option> <option value="AU"> Australia </option> <option value="AT"> Austria </option> <opt ...Show All
SQL Server Query syntax
Hi all! I am new here and I'm also new to SQL.. I hope somebody could help me regarding my problem. I don't know if this is possible but I would like to have a code that can integrate data from 3 tables. The names of my tables are Savings, Loans and Insurances. Their common field is the MemberID. One member could have zero or more Savings Accounts. At the same time, a member could also have one or more accounts on Loans or Insurances. How can I get the data that would appear like this: MemberID - Savings Account - Loan Account - Insurance Account 0001 - S0001 - L0002 - I0001 - S0003 - L0005 - 0002 - S0012 - - 0003 - S000 ...Show All
Visual FoxPro How can I get the ole_handle from an bmp image file?
In my application I need to call the method third party control, the method need pass in ole_handle of image file . I try to use h1=fopen("c:\test") and pass in h1. it did't work. In VB6 I can pass in img1.picture.handle and it work fine. Have Anybody has any idea THanks, CetinBasoz, Thank you very much . It work fine. ...Show All
Visual Studio Express Editions Controls on tab pages just disappearing
Hi there! I am experiencing the following problem: From time to time, all controls placed on the currently active tab page just disappear and reappear only after reloading the project. This behavior is very disturbing and eats a lot of time for closing/reopening etc. Is this problem known to anybody Does someone have a solution Best regards, Merry Its refreshing the form or someting like that...i dont think you can disable it...i know its annoying and it happens to me too.. ...Show All
Visual C# SortedList with a Generic Value
Hi there, I want to use the SortedList<> as aTyped lookup for some classed i have. all the classes inherit from ObjectTable<T> where T is the type of a business object. ObjectTable<> exposes methods like Save, Archive, Delete etc. Now my question is, can I use a generic SortedList / Dictionary to accomplish the following: SortedList<string, ObjectTable<>> tableList = new SortedList<string, ObjectTable<>>(); tableList.Add("Customers", customerTable); // here customerTable is derived from ObjectTable<Customer> and then can I access the newly inserted table's methods like this tableList["Customers"].Save(obj); Thanks! Marcel ...Show All
Internet Explorer Development IE7 Tabs
I am looking for a way using the SendMessage API or something along those lines to activate a different Tab from an external application, so I can detect if a URL is already open and restore that instance of IE and automatically switch to the proper tab. What I would like to see is the ability to list all open tab URLS and page titles, and the ability to activate the different tabs. Even if it is not coded directly as an API just information on what is the best way to do this. Currently I am developing an add on application to a product my company sells that opens the users current instance of IE if they are on the correct page or launches a new one if they are not. Currently I list all windows in the threa ...Show All
Windows Forms combine datasets
i have 4 datasets and i want to combine all 4 of it into 1 dataset..any help If you need only one table, I think you need add row by row according your logic, but I think add relations between tables would be more flexiable, we can add relations between tables in one dataset, code as follow: using System; using System.Data; using System.Data.SqlClient; namespace Microsoft.AdoNet.DataSetDemo { class NorthwindDataSet { static void Main() { string connectionString = GetConnectionString(); ConnectToData(connectionString); } private static void ConnectToData( string connectionString) { //Create a SqlConnection to the Northwind database. using (Sq ...Show All
