StaticTony's Q&A profile
Visual Studio Express Editions how some help fix my code?
'Create a new MailMessage object and specify the"From" and "To" addresses Dim Email As New System.Net.Mail.MailMessage(" From@abc.com ", " To@abc.com ") Email.Subject = "test subject" Email.Body = "this is a test" Dim mailClient As New System.Net.Mail.SmtpClient() 'This object stores the authentication values Dim basicAuthenticationInfo As _ New System.Net.NetworkCredential("username", "password") 'Put your own, or your ISPs, mail server name onthis next line mailClient.Host = "Mail.RemoteMailServer.com" mailClient.UseDefaultCredentials = False mailClient.Credentials = basicAuthenticationInfo ...Show All
Windows Forms How does the datagrid know when to "update" from changes in a dataset
I have a dataset which I want to update from an external thread. I know that updates need to occur in the forms thread so I was thinking about creating an object which wraps the dataset so that I can make sure that all updates occur in the form thread. The problem is that I don't see any events in the interfaces in objects that the datagrid's datasource property supports. How does the datagrid know that it needs to redraw the data in the dataset For instance, there doesn't seem to be a way where I could lock the dataset in the update thread and prevent the datagrid from accessing the dataset directly. I've looked around on the groups and on the internet in general and the articles about updating a datagrid from a external thread are not ve ...Show All
Windows Forms RichTextBox question
I am using odbc driver to manipulate records to and from a Paradox database. In the Database I have two columns that are Paradox 5.0 memo fields, they have been formatted with a Rich Edit field in Delphi7 . I can view the data in the fields in my C# app in MSVS 2005 with a RichTextBox control except that the formatting shows in the text box as well as the data. Like this: {\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcharset0 MS Sans Serif;}{\f1\fnil MS Sans Serif;}} \viewkind4\uc1\pard\lang1033\b\f0\fs16 3/4x3/8--63/4x4/78--One X Leather--One 1/2" wedge. Hook heels around instead of cutting off.\f1\par } Is there a way to get the richtextbox to process the formatting Thanks Jon (Moderator: Thread moved to thi ...Show All
.NET Development ConfigurationElementCollection class correct usage.
Hi, I want to create my SecureWebItemElementCollection class that is derived from the ConfigurationElementCollection class. But it isn't clear for me what is correct way to override protected virtual ConfigurationElement CreateNewElement (string elementName); method. What "element name" means here For example my elements in XML file are defined as <secuireWebItems enabled="true"> <add path="~/Administration" type="directory" /> <add path="~/Order/CreditCardData.aspx" type="page" /> </secuireWebItems> The path attribute is a key. Should I use the elementName parameter as value for the path in this case What will happens if I will not overr ...Show All
Visual C++ Sharing a single dll among multiple processes.
Hello, I have a DLL, created using VC7 and that DLL is to be used by two EXEs, I need to know, whether it is possible load the DLL only once, so that the same instance is used by both the EXEs. If its possible then how it is done. Thanx. I hope you need data that will be shared cross two processes. See, this thread. http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=921874&SiteID=1 You can declare process shared section #pragma section ( ".shared" , read, write, shared) Then use __declspec ( allocate ( ".shared" )) to declare shared data. #define SHARED __declspec ( allocate ( ".shared" )) SHARED volatile LONG g_nInstances = 0; //Cross process s ...Show All
Visual Studio Adding a comment and relating to a diagram item
I can add comments to my diagram, but I can't figure out how to link/relate it to another item on my diagram i.e. a class or interface TIA swin ...Show All
Windows Forms Label with invisible background.
I have a form with a label in it. I want to show the label, covering the whole form, with a number in it. The app is a multii screen image viewer, I'm trying to show which monitor is which. I've set the style to allow transparent background ( I'm interested to know what genius came up with that idea ), I've set the deprecated 'DrawTransparent' property, I've set the background color to Color.Transparent, but no matter what I do, including downloading several controls on the web for transparent labels, I cannot get a label that doesn't erase it's own background to the color of a general dialog box. Does anyone have any suggestions Thanks It works fine for me, but not with a ComboBox, which appears to redraw its text area over the ...Show All
Visual C# Different color on overloaded operators
I think there should be a setting where you could set another color for overloaded operators. Because if you have'nt seen the overloaded operator the code can create some errors in the code. I'm seventeen and come from Denmark, so my english can be ugly Best regards Lasse Espeholt Lasse, Thanks for the suggestion! I've added it to the list of suggestions that we prioritize for each version. This falls under a category of suggestions that we've seen that have to do with somehow visually conveying more information about a type/method/operator etc. For example, another suggestion is to colorize types which implement IDisposable (differently from normal types). Yet another is to colorize properties differ ...Show All
Windows Forms Datagridview::copy row including hidden column to another datagridview
I have SourceDGV whose Column1 I hide programmatically. How can I dragdrop copy SourceDGV's selectedrow including the hidden column to TargetDGV and keep that Column1 hidden on TargetDGV Thanks for any help ! The following code might be useful. Instead of dragging the selected from dgv1 to dgv2, i select a row on dgv1 and click the button on the form. then the selected row will be copied to dgv2. one of the columns in dgv1 is hidden. public partial class Form1 : Form { DataTable dt = new DataTable(); DataTable dt2 = new DataTable(); public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { dt.Columns.Add("col1& ...Show All
Visual Studio Team System Build history not deleted when deleting Team Projects?
I have the following situation: Created Team Project "ProjectA" Created a new Build Type named "Nightly Build" and run it 10 times Then I deleted ProjectA with TFSDeleteProject Next I installed Scrum for Team System I then created a new project again named "ProjectA" I created a new Build Type again named "Nightly Build" I run that Build Type 2 times When I add a new Sprint Backlog Item and go to the "Bug Details" tab and click to open the Build combobox I get to see the total of 12 build histories while I was expecting to only see the last 2. In the database TfsBuild I can only see one build so these builds must have been cached in the registry Because I cannot access the Registry due to the net ...Show All
.NET Development VB .net syntax primer?
Other than books online, are there any decent primers out there to learn basic VB .net syntax I've been coding for years (mostly Delphi and SQL/T-SQL with a touch of VB scripting) so know programming, I just need to pick up the syntax. (I'm interested in it mostly for implementation in SQL Server 2005 - CLR and SSIS.) (Posting here because there's no .net beginners forum. Hope this is the right place...) Thanks. If you're looking for more of a syntax primer check out this URL http://msdn2.microsoft.com/en-us/library/sh9ywfdk.aspx ...Show All
SQL Server SQL 2005 Express and Visual Studio 2003 - Connecting
I have Visual Studio 2003 and had used it successfully with MSDE. I recently upgraded to SQL 2005 Express and cannot seem to connect to the SQL server. it appears in the list of servers on localhost, but when I try to create a new database it tells me that it "cannot create databases on this server." It will not even open up any existing databases. I have .NET 2.0 installed. I uninstalled SQL and reinstalled it, but nothing seems to help. I feel I must be missing something, but do not know what. I no longer have the MSDE installation files, so I hope I can get Studio to talk to SQL Express. Any help is appreciated. I do not remember how to use osql.exe, but I recall there was someth ...Show All
SQL Server Date & time formats
I'd like to be able to display date/time in a format appropriate for the location of the viewer. (i.e., for March 15th the date would be 3/15/2006 for US viewers and 15/3/2006 for UK viewers.) What would be the simplest way of implementing this Thanks! Try setting the Report Language to an expression that equals the language of the user running the report. The expression looks like this. I haven't tested this so let me know if it works. =User!Language ...Show All
Visual C# Creating reading layout
How can I create reading layout such as there is in MSWord (press ALT+R in MS WORD) ...Show All
.NET Development Node vs. Element? Collapsing... Elements?
I've been developing a customized C# XML serializer, because of the lack of support for Generics using the XmlSerializer class, and I use the XmlElement quite a bit. One of my questions is what is the major difference between a Node and an Element I see that the XMLElement class inherits from XmlLinkedNode, which inherits from XmlNode, so does the word "element" simply define a "group of nodes", but can be a single node I am just curious about is all. Whatever the "group" is, my real question lies with how to programmatically collapse these "groups" My Xml file will be representing a config file that can easily end up to be 20+ pages long, so it would be really helpful to collapse ...Show All
