TA123's Q&A profile
SQL Server LEN performance issue
I am trying to tune a sql statement that is using len(prd.AssignmentAB) > 0 and this filter cost is too large. is their a better way to do this check, the field is a varchar. Please help. Emad How big is the column Is it too big to be indexed Another way you can do this is: prd.AssignmentAB > '' ... that will actually be able to use an index, (if the column is under 900 bytes and can therefore be indexed)... If that's not an option, you might try creating a computed column based on your LEN expression, and then indexing that. -- Adam Machanic Pro SQL Server 2005, available now http://www.. ...Show All
SQL Server How do I underline a text box
Is there a way to place an underline style on a text box Or just underline a texbox I don't want to underline just the text in a textbox but the entire textbox (whose width and number of lines is variable based on string variable) Thank You hey there this is what I use high light text box - in properties - border style - drop down to bottom and change to solid otherwise there is a line tool in the tool box. cheers Dianne ...Show All
Visual C# String.Join on an array of objects instead of strings
Question The string.Join is a handy operation, but it doesn't operate on objects and extract the joined string from an overloaded ToString(). Is there a better way to write this code snippet or am I missing fundamental Code // List<Portfolio> Portfolios is a list of Portfolio objects which // are a specialized class where ToString returns a data ID which // needs to be joined. List< string > ports = new List< string >(); foreach (Portfolio pf in Portfolios) ports.Add(pf.ToString()); string portfoliosJoined = string .Join( "," , ports.ToArray()); WHY Winform controls such as the combo box, will take an array of objects and use the overloaded ToString() to use as the Text to display to the user. ...Show All
.NET Development BaseNumberConverter throws Exception of type System.Exception (BUG in framework?)
Last months I try to improve my programming style so that I only catch Exceptions related to the method I execute. I had a small discussion about that in following forum http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=806282&SiteID=1 and you find a lot of other resources why you should do that. Today I was converting Padding to string and back to Padding. And when I tried to convert an invalid string, I received an exception of the type System.Exception . I looked a bit deeper in the Framework and the exception is thrown in the method FromStringError of BaseNumberConvertor . internal virtual Exception FromStringError ( string failedText, Exception innerException) { return new Exception ( SR . GetString ...Show All
Visual Basic Custom radio button column in DataGridView
I am working on adding a custom radio button column to a databound datagridview in a VB.Net app (Visual Studio 2005) and I'm a bit out of my depth. To get access to the custom classes, I've added a reference to a dll offered by Microsoft at http://msdn2.microsoft.com/en-us/library/aa730882(VS.80).aspx When I bind my datagridview to my dataset, the datagridview has the custom column and each cell in the column contains an unchecked radio button and the text false. What I need help with are two things: 1. When the datagridview is bound to its datasource to make one cell in the column have its radio button checked and its text reading "true" 2. A way to allow a user to click the radio button in any cell and for the radio button's ...Show All
Windows Forms Forms inheritance CreateInstanceImpl
I have some chain of inheritance forms (one form inherited from other) and I have change their constructors to have parameters and I got the following error in the design view while the project compiled. I have found out that all forms should have a default (parameter less constructor) and that fixes the problem. Does any body know how to handle this problem without changing the constructor My ancestor form holds some objects that all other forms uses. For that inheritance was made isn’t it at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, B ...Show All
Windows Forms Fill ListView?
Hi, I can figure out how to add items to the first column, but how do I add items to the second, third... columns Thanks, Somthing like this: ListViewItem item = listView1.Items.Add( "1.1" ); item.SubItems.Add( "1.2" ); Yours Markku ...Show All
Windows Forms Running an Assembly across a Network
I have a Windows Form application that uses SQL Server and C1 Libraries. No problem exists if I copy the entire Assembly to remote systems but it would be much easier if users could have a Shortcut directly to the \\server\program.exe on users desktops. I suspect that CAS has resulted in the error:- System.Security.SecurityException was unhandled Message: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. Any suggestions as to where I start would be very welcome ! Peter Check this thread... ...Show All
Community Chat JimmyWidgets
--- Original Post --- Hi everyone! My current project is JimmyWidgets, a widget program like Apple Dashboard, but for PC! You can even make new widgets in DLL format and post em on the online database! When I've made more widgets (I've only got 2 at the moment), I'll post it at www.jimmyware.co.uk . It's going to be open-source, so you can download the source from there too. Here's a screenshot: http://www.freewebs.com/robinjam/JimmyWidgets%5FScreenshot.jpg I await any comments/suggestions! (But please don't be too harsh about my efforts, it took me HOURS) P.S. A list of problems I need to fix: The online database currently lets you download the same widget twice, making startup time longer (because ...Show All
Visual Studio 2008 (Pre-release) Bad request?
I am getting the following exception: TestCase 'TestGetBasket' failed: System.ServiceModel.ProtocolException: The remote server returned an unexpected response: (400) Bad Request. System.ServiceModel.ProtocolException: The remote server returned an unexpected response: (400) Bad Request. ---> System.Net.WebException: The remote server returned an error: (400) Bad Request. at System.Net.HttpWebRequest.GetResponse() at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout) --- End of inner exception stack trace --- Server stack trace: at System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebRequest request, HttpWebRespo ...Show All
Visual C++ Measuring run time of a process or function
Hi I'm trying to measure the CPU run time of a process. Currently I'm using GetTickCount and GetTickFrequency but the given time includes the context switch time and the run time of other processes running along with my process. Is there an API function to get the precise CPU time of the process without the dependency in the condition of the OS and other processes An example for that is the CPU time given for each process in the Task Manager, but I need a milisecond measurement. Hoping to get help... Thanks! Turn off hyper threading option in your computer. The and you will fill the diffrence. The reason: hyper threadin is hardware imulation of two procesor, but exactly one processor ...Show All
Visual Studio 2008 (Pre-release) 3D animation Performance
Into a Canvas filled with (about 20) static 3DGeometry rectangle-shaped, each one texturized by images or MediaVideo, I'm moving a PerspectiveCamera with 2-seconds animations. I notice a quite poor performance on this; every animation shows not more then 20 different frames on a Hp xw6200 with NVIDIA Quadro NVS 285 128 MB. Animation is applied both to position and lookdirection properties of camera. I appreciated no significant progress using only images texture. Anyone has any kind of tips to apply to this It should be a better choice animate single shape instead of moving the whole canvas (moving camera) from performance point of view Some video seen on channel9.msdn.microsoft show very fluid and fast 3D animations, so where is my ...Show All
.NET Development Smtp Server Authorization
I found out that i’m not only one who has this problem. It seems Credentials in SmtpClient not works for everybody. When i use HOST: mail.hotmail.com, RECIPIENT: someone@yahoo.de (host and recipient domain are different) and the SMTP server requires to authenticate sender, this code should help: Dim mySMTP As New Mail.SmtpClient( "smtpserver" , 25) mySMTP.DeliveryMethod = Mail.SmtpDeliveryMethod.Network mySMTP.UseDefaultCredentials = False mySMTP.Credentials = New NetworkCredential( "username" , "password" ) mySMTP.Send(myMessage) But is NOT working! Why I try more different host and recipient domains and each requires standard authorization (username, pass ...Show All
Windows Forms Custom non-rectangular title for Form
Hello. I need to be able to define a non-rectangular (polygon) title for my Form window. I still need to be able to resize/maximize window. The goal is to be able to put two (for simple case) logo images of different size on the title (make them non client area elements). I failed to find a way to do it. The only solution exist is non-rectangular Form, but it is not resizable/maximizable and therefore does not fit. Please advise whether it is doable and how. Thank you. Thank you for your answer. However, i am looking for solution of the title customization and not the whole application. I need resizing as well which is impossible with the current solution of the custom shaped form. I will be glad to hear another idea if you have. Oth ...Show All
.NET Development Best Practice: Activity status
I'm back again! For me this is a bit hard to grasp/tackle. My application has a UI and several other classes. I know that no class should interact with the other if its not needed, which is fine. I know about these things. If I have a class doing some work (not the UI), I want to be able to notify the UI of the status/activity that is going on in this work. Is it correct for me to say that I should create events which would be raised from this class, so that the UI will catch it and display the status to the user Obviously this "work" class knows nothing about the UI class, nor does it need to. All it needs to do is its work and then display the status of what its doing, wherever this status is displayed is none ...Show All
