I am looking for a good book that explores .net diagnostics in depth such as topics about Tracing, Listeners, Event Logs etc. in .NET. Does anyone have any suggestions? I can't find any so far. Mark Sanders
Mark Sanders
Posts
-
Diagnostics Book -
SmtpMail ErrorProblem solved. The webserver had to be setup in Exchange to be allowed to send emails out. Mark Sanders
-
SmtpMail ErrorI am having a problem sending email using
System.Web.Mail
. I have provided detailed information about the issue below. Any help or comments would be greatly appreciated. ---------------------- NETWORK SETUP: ---------------------- - Web Server - A server running windows 2000 and IIS5. - Email Server - A seperate server running windows 2000 and Exchange 2000. --------------------- ERROR C# CODE: --------------------- Comments: If I entersomeone@mycompanydomain.com
for thetestMessage.To
property everything works great. I have also tried putting in the actual ip address of EXCHSRVR, but it did not change anything.MailMessage testMessage = new MailMessage(); testMessage.To = "me@anotherdomain.com"; testMessage.From = "me@mycompanydomain.com"; testMessage.Subject = "Test Email"; testMessage.Body = "Am I working???"; SmtpMail.SmtpServer = "EXCHSRVR"; SmtpMail.Send(invoiceMessage);
----------------------------- EXCEPTIONS THROWN: ----------------------------- Comments: I find it very strange that the
System.Runtime.InteropServices.COMException
says, "Unable to relay forme@anotherdomain.com
." I would think it should say "Unable to relay forme@mycompanydomain.com
." Main exception.**System.Web.HttpException**
Message: Could not access 'CDO.Message' object. Error Code: -2147467259 First inner exception.**System.Reflection.TargetInvocationException**
Message: Exception has been thrown by the target of an invocation. Second inner exception.**System.Runtime.InteropServices.COMException**
Message: The server rejected one or more recipient addresses. The server response was: 550 5.7.1 Unable to relay for me@anotherdomain.com --------------------------------------------------------- INTERNET HEADER FOR A SUCCESSFUL SEND: --------------------------------------------------------- Microsoft Mail Internet Headers Version 2.0 Received: from NS ([64.243.150.162]) by exchange.mycompanydomain.com with Microsoft SMTPSVC(5.0.2195.6713); Tue, 30 Sep 2003 10:25:20 -0500 From: me@mycompanydomain.com To: someone@mycompanydomain.com Subject: Test Email Date: Tue, 30 Sep 2003 10:25:20 -0500 Message-ID: 000101c38767$0f291e00$b80103c0@mycompanydomain.com MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: -
Creating a Wizard Type ApplicationI am trying to make a wizard type application. For example, an install application will have multiple forms with a next button to go to the next form. The problem is that I don't know how to jump from form to form without the form being closed and removed from the start taskbar and the next one loaded. This causes continual movement in the taskbar, which is both anoying and potentially confusing to some users. Does anyone know how to go from form to form while keeping the same button in the start taskbar? I have tried to do a MDI type solution but it seems to be more of a pain. Just wondering if there is a typical way to do this. Mark Sanders
-
Custom "Add Item"I am wanting to create my own "Item" for use in the "File|Add New Item" dialog window. Does anyone know of any resources which would point me in the right direction? FYI: The item I want to create is an option to add a StronglyTypedCollection class. Thanks. Mark Sanders Lowrance Electronics, Inc.
-
SQL Server Structure AccessDoes anyone know if it is possible, using C# and the .NET framework, to get access to the structure of databases in SQL Server? When I say "structure" I mean for example, a programmatic way to get the name of all the tables and their fields and relations, when you know nothing about the database except a connection string for it. Mark Sanders
-
Dedicated .NET Hosting w/ SQL ServerI am looking for a dedicated .NET and SQL Server hosting provider. I would like to be able to host multiple sites and I hoping to find something in the $400 range (though I don't know if that is possible). Does anyone have any suggestions? I seem to find a lot of really nice dedicated deals but they never include SQL Server without forking up a lot of cash for it. Mark Sanders sanderssolutions.com
-
Dll Function ExtractorI have been given a VC++ 6 dll which has no documentation and no code. I need to find out what functions are available in this dll. Does anyone know of a utility somewhere that can show you the public functions of a dll? Something similar to Lutz Roeder's .NET Reflector[^], but for a VC++ 6 dll. Thanks, Mark Sanders
-
Single Dll CompileIs it possible to have 2 different C# Class Library Projects which individually compile to their own dll and then add the 2 projects to a solution and make them both compile into 1 dll while still allowing for them to individually compile into seperate ones when accessing only the individual project? FYI: I am using VS.NET 2002 Thanks Mark Sanders sanderssolutions.com
-
Design QuestionHere is my situation... I have to develop tables for a specific product. Currently I have a "Product" table which has the "ModelId", "Features", etc. There is also a table I have called "ProductDetails" which some special performance data. The problem is, this product can be "Mounted" in three different configurations. The product information for each of the three different mounts are identical but they have a different "ProductId". What is the best way to design this? Thanks Mark Sanders sanderssolutions.com
-
External Firewire Hard DriveI have tried to get some help from microsoft.public.windowsxp.hardware with no luck so I thought I would try my fellow cpians. I have a strange situation, I think, with an external hard drive. I have an 80GB external firewire hard drive which I connect to my Sony Vaio laptop running Windows XP Pro using a 6-pin to 4-pin cable. It appears that Windows has located the drive just fine because I have been able to initialize and format it and it shows up as drive F:. Two strange things are happening though. 1. All of the text in Windows explorer with regards to the external drive are blue. For example, the label "Disk (F:\)" in the "folders pane" is blue, the text for folders in the right pane are blue etc. Does this mean something? 2. If I start my computer with the hard drive connected and turned on Windows will run Check Disk in an endless loop. So, I have to start the computer, then when Windows is all booted up I can then turn on the hard drive. Does anyone have any insight into this? :confused: Mark Sanders
-
Writing a DataTable As DBF (Long Post)I adjusted my code to use parameterized queries but have not gained a significant enough performance boost. After some performance tests I have found that my OleDbCommand.ExecuteNonQuery() takes an average of 0.004 seconds to execute (with the max occurance being 0.015 seconds). With my current mid-range test I do this for 145,160 records for a total of 9.85 minutes! After some more research it appears the general concensus is that ADO.NET is unable to do this type of operation any faster. So, my new question is... I have no choice in the requirements. I must take a DataTable and write it to disk as a dBASE IV table. Does anyone have any ideas on how to do this in the fastest possible way? Mark Sanders
-
Best Looking SitesWhat internet sites do you all feel have the best looking designs? Sites which are clean, crisp, professional, and creative. Mark Sanders sanderssolutions.com
-
Writing a DataTable As DBF (Long Post)I have been trying to find some examples of setting up an INSERT into a .dbf using OleDbParameter class. I have been unsuccessful. Can you point me to some examples? I understand how to use parameters with SQL Server stored procedures but I seem to be missing something when it comes to using parameters for and Ole connection to a .dbf. Here is what I have so far but it is not working.
string connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\;Extended Properties=dBase IV"; string sqlString = "INSERT INTO TestTabl (Column) VALUES (?)"; OleDbConnection connection = new OleDbConnection(connectionString); OleDbCommand command = new OleDbCommand(sqlString, connection); command.Parameters.Add("@Column", OleDbType.VarChar); command.Parameters["@Column"].Value = "It Worked"; command.Connection.Open(); command.ExecuteNonQuery(); command.Connection.Close();
Thanks Mark Sanders
-
Determining Memory SizeI have a program written in C#/VS.NET and I am trying to find out how much memory a specific instance of class is using during runtime. Does anyone know if there is a feature in the VS.NET debugger that would let me know this information? Or, do you have any ideas on how I could get an accurate estimate of it's size? FYI: Monitoring the "Perfomance Tab" of the "Windows Task Manager" is not accurate enough for the information I am needing. Mark Sanders sanderssolutions.com
-
Writing a DataTable As DBF (Long Post)This will be a long post but any insight will be greatly appreciated. Process Description: I have to write a C# method which will take as its parameter a
System.Data.DataTable
and then write thisDataTable
to a new dBASE IV table on disk. Current Solution: (not a good one) Here is my current solution in C# which is very very very slow (It takes 5+ minutes to output a 10MB .DBF on a dual 2.4 Zeon machine with 2GB of RAM running a RAID 5). :((public void WriteTable(DataTable table) { //First, I create a column string to use in the CREATE TABLE sql statement. string columnString=""; foreach(DataColumn column in table.Columns) { string type = ""; switch(column.DataType.ToString()) { case "System.String": type = "varchar(" + MaxLength(column) + ")"; break; case "System.Int32": type = "int"; break; case "System.Double": type = "double"; break; default: throw new ArgumentException("Data type not found.", column.DataType.ToString()); } columnString += column.ColumnName + " " + type + ", "; } columnString = columnString.Substring(0, columnString.Length-2); //Done creating column string. ////////////////////////////////////////////////////////////////////// //Second, I create the new table on disk. connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + directory + ";Extended Properties=dBase IV"; sqlString = "CREATE TABLE " + name + " (" + columnString + ")"; connection = new OleDbConnection(connectionString); command = new OleDbCommand(sqlString, connection); command.Connection.Open(); command.ExecuteNonQuery(); command.Connection.Close(); //Done creating table. ////////////////////////////////////////////////////////////////////// //Third, I insert each record into the new table. command.Connection.Open(); int columnCount = table.Columns.Count; foreach(DataRow row in table.Rows) { string valueString=""; for(int i=0; i < columnCount; i++) { switch(row[i].GetType().ToString()) { case "System.String": valueString += "'" + ((string)row[i]).Replace("'", "''") + "', "; break; case "System.Int32": valueString += System.Convert.ToString((int)row[i]) + ", "; break; case "System.Double": valueString += Sys
-
Collection Sort PerformanceThe collection cannot be automatically sorted. In use, the collection will usually be unsorted. Only on occasion will sorting be necessary. Thanks. Mark Sanders sanderssolutions.com
-
Collection Sort PerformanceI am creating a strongly-typed collection class for a custom class using the CollectionBase class. I have added a Sort() function to the class with the following description:
public void Sort() { myClass[] tempArray = new myClass[List.Count]; tempArray.Initialize(); List.CopyTo(tempArray, 0); Array.Sort(tempArray); List.Clear(); foreach(myClass val in tempArray) List.Add(val); }
Is there a better way to do this, performance wise? Or is this implementation a decent one? FYI: The list count for this collection will be very large when used in the application. Mark Sanders sanderssolutions.com
-
.dbf CreationFor those who are interested...
string columnString = "NAME varchar(50), NUMBER int"; string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + directory + ";Extended Properties=dBase IV"; string sqlString = "CREATE TABLE " + tableName + " (" + columnString + ")"; OleDbConnection connection = new OleDbConnection(connectionString); OleDbCommand command = new OleDbCommand(sqlString, connection); command.Connection.Open(); command.ExecuteNonQuery(); command.Connection.Close();
Mark Sanders sanderssolutions.com
-
.dbf CreationIs it possible to create a new dBASE IV .dbf (one that does not already exist) using C#? Mark Sanders sanderssolutions.com