saurabh1531's Q&A profile
.NET Development Winforms Project Error: Trust Relationship between this workstation and primary domain failed.
Good day. I created some program(winforms) in C# that connects to certain database (Access, SQL Server, Postgres) by setting the connection string in the app.config file. It's about security, creating users on database and creating/associating their roles and rights. When compiled, it will show a login form, after logging in with the correct login info's, it will show a main security form that will manage users (add users, add/edit rights, roles, view rights and roles). I use Visual Studio 2005. The program uses a class that is derived from the Microsoft Data Application Block. It already contains the classes for Accessing MS Access and SQL Server. I just modified and created another class for Postgres, since it's my primary database as of ...Show All
Visual C# How do I Retrieve text from other programs?
Hi guys, I'm currently trying to come up for a solution for the following problem: Right now the user is reading values off a screen and manually copying them into another window to store in a databse. Because of the closed nature of the program they are using I can't edit the program, and was trying to figure out how to automate this process. Summary: I want to read the displayed text values off the window of another program. anyone know how to do this Or at leaste can anyone point me in the right direction for some learning sources or api classes that might be related Thanks a bunch, Hello , I have used this code as is but I don't know where should the result "Text" be , but I ...Show All
Visual Studio Team System Get labled files with TFS API
Hi, I can get latest files from TFS using GetStatus status = ws.Get(serverItems, VersionSpec .Latest, RecursionType .Full, GetOptions .Overwrite | GetOptions .GetAll); but, how can I get all the files that belong to a label Thanks. You might want to take a look at the VersionSpec class in the documentation. There is a subclass of VersionSpec called LabelVersionSpec that has functionality for specifying labels. Passing an instance of LabelVersionSpec as your second parameter instead of VersionSpec.Latest could be a good bet. http://msdn2.microsoft.com/en-us/library/microsoft.teamfoundation.versioncontrol.client.labelversionspec(VS.80).aspx ...Show All
Visual C# Controling Controls from other Forms
Hello! I have to Windows Forms - Main.cs and Menu.cs I would like to control the richTextBox control from the Menu.cs Windows Form. The richTextBox control is located on Main.cs. How can I do that: For example how can I execute the "copy" method of the richTextBox which is on Main.cs from Menu.cs. Please help! Thx Matt When you create the form its create a partial class for that now go to the form right click on its Initialize() and go to defination at the end of file there will declaration of all controls you can find your richtext box there now modify it to be static. ...Show All
Visual Studio Express Editions Query Avg,Min,Max in an Access/Jet database problem
Hello, Why Select AVG(Something) As Expr1 From Table1 returns the Warning message: "The schema returned by the new query differs from the base query" in Search Criteria Builder. Is any solution to this problem Thanks, You are certainly right, there is no code on that Form. I believed that the same way as the GridTable was filled, I could drag the desired column from the Data Sources window and perform a querry on it for AVG. The tried that lines "SELECT AVG("somecolumn")........" in the Querry Builder (it wouldn't yield......that was the message what I got instead). ...Show All
Visual C# How do I refrance an object after I have created it ?
I have created a class called clsserver and it inherits from the Picturebox class. Basically it is a picture of a server and displays as different colours as the status of the server is found, ie green is good, yellow might be a problem and red is can not access. With the Gui I can display multiple server on the screen ie 15 of these clsserver classes left to right, top to bottom. In the code I have called the instances of the class server. for each server I run this code. Server = new SQLServerMonitor.Server. clsServer () Server.Name = ThisServerName //IP of the server Server.Parent = pnlbackPanel; //calculate where to place the picture box on the screen if (ServerCount !=1) Calculateposistion( ref Left, ref ...Show All
Microsoft ISV Community Center Forums trapping 1004 Error when Excel VBA invokes Application object in Internet Explorer
My Excel application (not primarily intended for running in IE) uses Application.WindowState = xlNormal etc to resize Excel when the UserForm is initialized. Works fine when run in Excel normally, but if I 'Run' the download from my website instead of 'Save', so it opens in IE, the code generates a 1004 error "Method 'WindowState' of object '_Application' failed" that won't trap using 'On Error...'. How else can I head off this problem ...Show All
Visual Studio Team System Running outside TFS - Possible?
I've got almost the same software at home as at work, except for the Team Foundation Server of course. I've installed the VSTS at home and have added the VSTS-DP. Is there some way I can take the db project from work (on a usb drive) and work on it at home and then merge the modified files back into the TFS-VC EDIT ******************************************* Well, I grabbed all the files from work thru remote. Then tried to open it here at home. When it was opening it complained 3 times about not resolving the server name. And also warned me about source control and gave me the option to work temporarily uncontrolled. Toward the end of the load, it said I needed to go to Tools | Options and change the validation database ...Show All
SQL Server Help me convert date.. Urgent please
Hi... I'm with a problem here... I need to convert a date in a string like dd-mm-yyyy to yyyy-mm-dd in a SQL Query... How can i do that I need to use that in a query like this : Select CodeID, Name From Exams Where ExDate Between @Date1 And @Date2 This is urgent... someone help me please I would suggest this instead: CONVERT (smalldatetime,'26-12-2006', 105) ...Show All
Visual Studio Tools for Office How to get the images from a word document
Hi all I am using VS2005 and Microsoft.Interop.word assembly of word2003.How to read the word document which contains paragraphs and images.Can any one provide a sample code to accomplish my requirement. regards keshav Hi Yes your guess is correct.Thanks for your help.I should have explained clearly.I am sorry for that. Now I will explain clearly. I want to read the document which contains both text and images.As the word application reads every thing as paragraphs either it is text , image or table...... I am not able to access the images in document.But,I am able to access the paragraphs of word document which contains text by using the code below. Dim para As Word.Paragraph For Each pa ...Show All
SQL Server Slow connection to sql server 2005
I have a linked tables from access 2003 to sql server 2005 connected using odbc. the connection is very slow. when i use the same linked tables to sql server 2000 the connection is fine. what seems to be the problem Hi, Are you using the MDAC clients ODBC component or the SQL Native Clients one HTH, Jens K. Suessmeyer. --- http://www.sqlserver2005.de --- ...Show All
.NET Development Problem connecting to a shared drive from a VB.NET program
I have written an application that uses a central store of pictures on a server. This store is made accessible to the clients by simply sharing the folder as a networke drive (P:\) on all client computers. The problem I encounter is as follows: If my application tries to connect to this shared drive, it will not succed, unless this shared drive has been accesed first with explorer.exe on the client. Opening the share with explorer will immediately give my application the necessary access. I currently have a workaround in place, that opens the explorer with the parapeters for that shared drive on logon, so that when the user starts my application first, the connection will still succed. My question is simple: where did I make a mis ...Show All
Visual C++ Trying to change the menu fonts and dialog box to Arial in MFC
Hi, We are trying to change the menu fonts to Arial in MFC i.e. changing the fonts of File, Edit etc options to Arial from the font set by default. I tried to do this in the OnCreate function by doing it this way NONCLIENTMETRICS ncm = { sizeof(NONCLIENTMETRICS) }; bool x = ::SystemParametersInfo ( SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, false ); if(x == false) DWORD d = GetLastError(); strcpy(ncm.lfCaptionFont.lfFaceName, "Arial"); strcpy(ncm.lfSmCaptionFont.lfFaceName, "Arial"); strcpy(ncm.lfMenuFont.lfFaceName, "Arial"); strcpy(ncm.lfStatusFont.lfFaceName, "Arial"); strcpy(ncm.lfMessageFont.lfFaceName, "Arial"); ::SystemParametersInfo ( SPI_SETN ...Show All
Visual Basic updating totals
I have a form which shows total sales from an Access database, via a SQL string, when it is loaded. My form also allows me to add additional sales, however, I am unable to update the total sales field without closing and reopening the form - could anyone help me please Happy Christmas. I am using VB2005. Yes, I assume wrongly that if i save the new input data (using the binding naviator i.e. add new). The total sales should automatically update to relect the added value of the new input. Private Sub Button1_Click( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Try Me .Validate() Me .SALESBindingSource.EndEdit() Me .SALEST ...Show All
Visual Basic stepping through a loop with different objects
I have some code that involves 81 textbox objects. Is there a way to create a loop that can step through these objects and alter them For instance, I would like to take textbox1.text = "test" and also textbox2.text = "test" but I don't want to write this code out 81 times. Any suggestions Seems like there must be a way to just alter the 8th (or 7th if you start with a zero) place of the variable and run it through a loop using another variable integer.tostring but I can't figure out how. If you want to loop through all textboxes then For Each newControl As Control In Me.Controls If TypeOf (newControl) Is TextBox Then newControl.Text = "Test" End If Next Ultimately you c ...Show All
