Jim Jones's Q&A profile
.NET Development Casting from System.RuntimeType
I’m trying to load SqlConnection dynamically like this: asm = [Assembly].LoadWithPartialName("System.Data") con = asm.GetType("System.Data.SqlClient.SqlConnection") How can I convert con, which is of the type "System.RuntimeType", to SqlConnection Thanks You can't cast a Type object to a SqlConnection. If you want to create an instance of the type, check out the Activator.CreateInstance method. ...Show All
.NET Development Sending Email problem (.NET 2.0)
Hello folks! I'm trying to send email using the new classes of .NET 2.0, with the following code: MailMessage msg = new MailMessage(); msg.To.Add("bribeiro@certisign.com.br"); msg.From = new MailAddress("bribeiro@certisign.com.br", "Bruno Ribeiro", Encoding.UTF8); msg.Subject = "Teste de envio de emails usando .NET 2.0"; msg.SubjectEncoding = Encoding.UTF8; msg.Body = "Este e o corpo da mensagem."; msg.BodyEncoding = Encoding.UTF8; msg.IsBodyHtml = false; SmtpClient client = new SmtpClient(); client.Credentials = new NetworkCredential("bribeiro@certisign.com.br", "xxx ...Show All
.NET Development smtp problem (system.net.mail)
I've written email pro in asp .net Protected Sub Button1_Click( ByVal sender As Object , ByVal e As System.EventArgs) Handles Button1.Click Dim mail As New MailMessage() Try 'set the addresses mail.From = New MailAddress(" name@company.com ") mail.To.Add( youname@comapny.com ) 'set the content mail.Subject = "This is an email" mail.Body = "this is the body content of the email." 'send the message Dim smtp1 As New SmtpClient( "mail.company.com" , 25) Dim basicAuthenticationInfo As New System.Net.NetworkCredential( & ...Show All
Visual Studio Team System Changesets and Labeling
I'm trying to get familiar with the source control functionality in TFS before we migrate over from VSS. One thing I'm having trouble wrapping my head around is labeling. I can label a project, but I can't find anyway to find what label a changeset belongs to. I'm used to looking at the history of a project and then doing a "get" on the label. Thanks. Have you tried the Find Label dialog Beyond that, there isn't really a feature like you're asking for. Brian's blog has the short reason why: http://blogs.msdn.com/bharry/archive/2005/11/18/494439.aspx We're looking at improving the UI for la ...Show All
Visual C++ Microsoft Visual Studio Tools
When I installed the MS Visual Studio C++ , there was an option to install a set of tools (some tools for login, documentation, etc...) but i didn't install this. Right know I have a problem because I don't know from where I can download this, maybe any info (link) from somebody who knows where it is ...Show All
Visual Basic Validation - but from a class or function
I have numerous textboxes which I wish to validate and I am using If IsNumeric(txtBossAnnualSalary.Text) = False Then ErrorProvider1.SetError(txtBossAnnualSalary, _ "Please enter a numeric value") Else ErrorProvider1.Dispose() End If Rather than typing this code multiple times in each validating event of each field I want to put it in a class or function then just call - ValidateMyTextBox(). I have tried this numerous times but can not quite get the validating error message to show in the field that called it. Is this possible to do . Thanks in advance MJ ...Show All
SQL Server Paging Header and Detail
I would like to create a report with header and detail, like an invoice with invoice # and line items. I'd like the invoice # to come from a summary query that breaks 1 invoice # per page. Then I'd like to display the line items below the invoice # on each page, from a second query passing the invoice number as a parameter. How is this done Do I need a subreport ie: header from summary query: invoice 101 detail from detail query passed invoice # = 101: line 1 item A line 2 item B line 3 item C page header from summary query: invoice 102 detail from detail query passed invoice # = 102: line 1 i ...Show All
SQL Server 64bit problem?
I run SQL Server 2005 on a Windows 2003 64-bit server. I have created a package where I run an execute t-sql statement task. In the t-sql I have the following: select * from OpenDataSource('Microsoft.Jet.OLEDB.4.0','Data Source="c:\test.mdb";User ID=Admin;Password=').pubs.dbo.data and I get the following error: The OLE DB provider "Microsoft.Jet.OLEDB.4.0" has not been registered. There is only 32-bit version of Jet provider. You access it on 64-bit machine, if you run SSIS packages in 32-bit mode (using 32-bit dtexec from Program Files (x86) or setting appropriate option in project), a ...Show All
Visual Basic Using a Registry Launch Condition to Specify a Target Directory does not work
I am trying to use VS deployment as per http://msdn.microsoft.com/library/default.asp url=/library/en-us/vsintro7/html/vxtskusingregistrysearchtospecifytargetdirectory.asp but it does not work as intended. I have logged the installation failure.The launch condition seems to be evaluated after the target directory is formed so [INSTALLATIONPATH] retrieved from the registry is empty when it is supposed to be applied via DefaultDirectory in my custom folder. Any suggestions would be gratefully received. If you need to change the TARGETDIR value you can change the DefaultLocation property of "Applicati ...Show All
Visual Basic Making a picturebox have a transparent background
I have a picture of a panda with a pink background (panda_down.bmp) and I was wondering: how do I get that pink background to be transparent Draw the image yourself in a paint handler, and use the imageattributes class to make 255/0/255 ( magenta ) transparent. ...Show All
Visual C# vs2003 vs. vs2005
I noticed when I create a new Windows Application in visual studio 2005 it creates a file Form1.Designer.cs which is all of the generated code, and seperately there is a another file form1.cs which is what I suppose is for me to add code to Both of these files are partial classes But only form1.cs is public. Why the change from vs2003 where all this was in one file Tyler Perkins Visual Basic 2005 and Visual C# 2005 have come with a new feature called partial classes that enables classes to be extended across multiple files. As you've already noticed, the Visual Studio project system has made use of this a ...Show All
Windows Forms Inheritance and designers
I have a class 'SyntaxBox' which extends richTextBox to do some rudimentry syntax highlighting. How do I determine what designer richTextBox uses inorder to inherit it The thing that I usually do is check reflector. Reflector is a little program that disassembles .NET so you can browse the managed code. It can be found here . In reflector, search for System.Windows.Forms.RichtTextBox. You can do that by simple searching the tree or using the Find function (looking glass). From there, right click the class and select 'Disassemble'. You see the RichTextBox class definitiion there with all the attributes. ...Show All
Windows Forms how to create those dataset class files in web services?
I am new, and am learning the taskvision now. I noticed that there are a lot of DataSet classes files in the web services project. For example, DataSetTasks.vb, DataSetProjects.vb, DataSetProjectHistory.vb, ... I opened thoses files, at the beginning, it read: '------------------------------------------------------------------------------ ' <autogenerated> ' This code was generated by ...Show All
Game Technologies: DirectX, XNA, XACT, etc. how to create an 8 bit raw file?
Hi every one. Does anyone know how to create an 8 bit raw file from a bitmap The idea is to generate landscapes from those raw files and also to automatically generate the raw and then create the terrain. Thanks in advance. Cubaconn Instead of completely RAW format, I'd advise using the PGM format (or PPM if you need RGB rather than just an 8 bit value). You can find details of the PGM format at: http://www.wotsit.org/search.asp page=6&s=graphics The binary form of PGM is exactly the same as a RAW file, except it has the addition of a very simple ASCII header describing the contents of the file; ha ...Show All
Windows Forms ListBox question -- is there an 'ItemAdded' event or similar?
I need to do some processing whenever an item is added (or indeed removed, so changes generally) to a listbox. From a cursory glance at the documentation I do not find relevant events. I would be grateful however if anyone could point out that I am missing something. Or do I have to add a custom event If so, if anyone has code that could get me started I would again be very grateful. Thanks. There is no event or protected method that is invoked when the items change. There are a couple of alternatives however. The first option is to use a DataSource or BindingSource and handle the events within these object ...Show All
