Henry_Yang's Q&A profile
Windows Forms Find Method for a richTextBox (Help Please)
My question is this: What can be used as a DataSource for Formatting Text a Certain way The type of Text Formatting i'm working on in my project is a Casscading Style Sheet Generator,for a Site already In use(sorta like myspace.com)... Can you have a TextBox Read & Apply the text on a StyleSheet (CSharp) or would it have to be say a XML file Than the Form Controls will Edit the right sections of the CSS Example : table.user_aboutme { border:2px dashed #6694cf; <----------- Auto Insert of Color from CSS Supplied to the program text-align:left; padding: 2px; } td.user_aboutme_hdr { text-align:left; color:#2d7bbb; <------------------- In Every Spot threw out the CSS Supplied(DataSource) background-color:transparent; ...Show All
SQL Server Restore does not leave database in usable state......
So this is the c# code I'm using to do my restore from a backed up file, but after the restore is called the database cannot have sql statements executed against it. Any ideas are greatfully received public static void RestoreDatabase( Database db, string fileName) { RecoveryModel recoverymod = db.DatabaseOptions.RecoveryModel; DatabaseUserAccess originalUserAccess = db.DatabaseOptions.UserAccess; db.DatabaseOptions.UserAccess = DatabaseUserAccess .Restricted; if (db.ActiveConnections > 0) { MessageBox .Sho ...Show All
Visual C# C#.net DLL
how can I make C#.ne DLL file using visual studio .net 2003 thank u in advance In .NET it is called a Class Library - since Microsoft and .NET has moved towards an OOP and so you don't just define public functions like in prior dll's. Any classes,controls etc that are in this class library that wish to be used by other applications should be public. Once you have created your Class Library, added your code /classes you can compile it and then in other applications link to it so that you can reuse the code. Let us know if you have any further questions ...Show All
Visual C# Destructor or IDisposable implementation? or both?
Hi!. What's the difference I want that GC can dispose correctly my classes, but i don't know if is better write a destructor method or implement a IDisposable interface, or implement a IDisposable interface that call to destructor method.... What is the correct way Regards. Search for the "dispose pattern" and you'll find plenty of articles explaining how to implement it properly. Here's one: http://www.codeproject.com/useritems/idisposable.asp ...Show All
Windows Forms transfer data between/to forms
Hi,i have designed a application to handle employyees details.I got 3 forms I got 1 form to add a employee,1 form to delete and 1 form to update employee details. For each,form, i got a 'private void connectToDataBase()' method to establish aconnection to the database. Is it possible to have 1 form initially to handle the connection.......and then the rest of the forms make use of that conection Hope some-one knows how to do this. Thanx alot. Rahul The same question is asked on this thread: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1258143&SiteID=1 It is not a "connect to database" sharing that is discussed there, but rather a "sharing data". The ...Show All
Visual Studio Team System Identifying custom fields (Fields collection, GetById, CoreFields enumeration)
Having retrieved a work item using the Work Item Object Model, its fields are returned in a Fields collection. That collection contains many fields. Some of them are indexed by the CoreFields enumeration. Unsurprisingly these are predefined fields. We however use many custom fields. They are in the fields collection too. How can I easily acces the value of a custom field Is there an enumeration of csutom fields available that can be used with the GetById method Or is there another method for accessing the Fields collection in a Work Item object that I am missing Thus far the only solution I can find is to get a work item, then build an enumeration of all fields myself! How clumsy is that Surely there's a neater way. Here's some ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Need help with input
I'm really new to XNA and directx. I don't know very much at all. If someone could be so kind as to let me know how to make the mouse shift the camera around to look around. I lose everything from the screen when I try to change the view matrix to account for the mouse moving. Most of the code I'm using is from the help. Just trying to understand as I go. Actual Camera tutorials are hard to find, i did a post recently on my blog as an introduction to camera;s which you can look at, explains some basics and point to stuff that helps. Will be doing a follow up soon with a more detailed camera basics guide from what I've found. Hope this helps Darkside ...Show All
Windows Forms FormClosing Event
Hi Every body I have a form and i don't want to let the user close it by ALT+F4 or Click on the close button. I know i should handle FormClosing event but how When i use FormClosingEventArgs and write this code : if ( e.CloseReason = CloseReason.UserClosing ) { e.Cancel = true; } I can't close it by calling the close Method. I just wanna close the form by writing codes and not allow the users to close it manually. like SplashScreen forms or something like that.Oh by the way is there any article about creating splashScreen forms in C# thank you. Unfortunately, the CloseReason enum doesn't distinguish between the user closing the form and your code closing the form. A bit of oversight I'd say but ther ...Show All
SQL Server Need help to find a professional approach
Hi guys, I'm designing a sql server database for a recruitment site, I have a resumes table that stores pieces of information about every jobseeker, among this information is the employment history which includes(Job title, company name, from, to), of course one jobseeker can have multiple previous jobs. Now, I want to know how this structure would be applied this structure suggests a field within the resume table that is by itself is a table! So, any ideas how can I design this database Here is a good start: http://www.databaseanswers.org/data_models/cv_and_job_history/index.htm ...Show All
SQL Server Error in sending mails !
I am trying to send email thro DTS using Activex Script. Here is the code : ' ********************************************************************** ' Visual Basic ActiveX Script '************************************************************************ Function Main() const SMTP_SERVER = "MPBAKOREX01.corp.mphasis.com" set iMsg = CreateObject("CDO.Message") set iConf = CreateObject("CDO.Configuration") Set Flds = iConf.Fields With Flds .Item(" http://schemas.microsoft.com/cdo/configuration/sendusing ") = cdoSendUsingPickup .Item(" http://schemas.microsoft.com/cdo/configuration/smtpserver ") = SMTP_SERVER .Item(" http://schemas.microsoft.com/cdo/configura ...Show All
SQL Server Adding multiple fields together
Okay hopefully this is quick and easy. I have 3 fields (Annual Salary, Medical, Pension) and I now need to working out Cost To Company which is just adding those three together. I tried to do that in a formula but it doesn't return me anything... This is what I had. =(Sum(Fields!AnnualSalary.Value, "CoreEmployeeData")+Sum(Fields!AnnualMedicalAid.Value, "CoreEmployeeData")+Sum(Fields!AnnualPension.Value, "CoreEmployeeData")) So it should add the 3 records While you are here :), Can you tell me how I can put a currency symbol in the front of these numbers and add the thousand comma delimiter the easiest way to get aorund this issue is split out your sum to individual columns, ...Show All
Visual Basic Printing in VB.NET
Does anyone know how to print i vb I have information some textbox on a form which i want to send to the printer. Between the links that ahmedilyas and I've suggested, there should be enough information on how to print text (the sample shows how to print the contents of a text file, so you'd have to modify it somewhat to take the text from your textbox instead) Another option is to use the PrintForm component as I suggested in a previous answer, create a new form, put a textbox on it, set it to dock-fill, set the text of the textbox and print the form. If you could please clarify why you don't think that the information that we have suggested is enough, we may be able to help out some more. Bes ...Show All
Visual Studio Express Editions Wizard visual 2005 express edition?
Can you create a wizard in vb express edition are there any examples that work http://www.codeproject.com/vb/net/oobestylewizard.asp http://www.codeproject.com/vb/net/GNWizard.asp http://msdn.microsoft.com/library/default.asp url=/library/en-us/vsintro7/html/vxconcreatingwizard.asp http://www.divil.co.uk/net/controls/wizardframework/downloads.aspx ...Show All
Visual C# How i can zip files with SharpZipLib
Hello! i made file explorer that adds selected files to treeView3. i have spent alot time looking for samples of SharpLibZip, i want make my zip package contain filestructure.( example c:\folder1\folder2\somefile.ari, and saves those folders on zip). here is what i made up this far: try { string outputdir = @"C:\arska.zip"; ZipOutputStream ZipStream = new ZipOutputStream(File.Create(outputdir)); ZipStream.SetLevel(5); for (int i = 0; i < treeView3.Nodes.Count; i++) { TreeNode lastNode = treeView3.Nodes ; string file = treeView3.Nodes .Text; FileStream fs = File.OpenRead(file); byte[] buffer = new byte[fs.Length]; fs.Read(buffer, 0, buffer.Length); ZipEntry ent ...Show All
SQL Server Service Broker Queue Reader Question
I'm creating an app that could potentially send thousands of messages to a Service Broker queue in a matter of seconds. The stored proc that reads records off the queue will call a remote stored procedure for each message to save data in a remote database. My question is this. How does Service Broker determine how quickly to read those messages off the queue it was sent to Ideally I'd like Service Broker to do most of its work when SQL Server isn't busy doing other things instead of contending with SQL Server while it's doing perhaps more important work. Is there any way to control this How does this work Thanks very much - Amos There is no way to control the priority of the activated tasks, such th ...Show All
