Topics
-
- 0 replies
- 1.1k views
Hi, well i need to compare to images and iv found a way but was wondering if there is any faster way to do it.. any way here is my code: public static bool CompareImage(Image img1, Image img2) { //Test to see if we have the same size of image if (img1.Size != img2.Size) { return false; } else { //Convert each image to a byte array System.Drawing.ImageConverter ic = new System.Drawing.ImageConverter(); byte[] btImage1 = new byte[1]; btImage1 = (byte[])ic.ConvertTo(img1, btImage1.GetType()); byte[] btImage2 = new byte[1]; btImage2 = (byte[])ic.ConvertTo(img2, btImage2.GetType()); …
Last reply by Wing, -
-
- Administrators
- 1 reply
- 998 views
I have the following SQL code, but I want to check to see if the SQL user is already created before trying to run the create user code so as to avoid errors. Could someone tell me how I can do an if statement in SQL for this? EXECUTE sp_detach_db @dbname = N'MRCS', @skipchecks = N'TRUE' GO EXECUTE sp_attach_single_file_db @dbname = N'MRCS', @physname = N'C:\Program Files\Ticodi\MRCS\Database\MRCS_Data.mdf' GO [color="Red"]If user does not exist then do this code[/color] EXECUTE execute sp_addlogin @loginame = N'MRCSAdmin', @passwd = 'dragnet', @defdb = N'MRCS', @deflanguage = N'us_english' GO [color="red"]Endif statement[/colo…
Last reply by PlausiblyDamp, -
-
- 0 replies
- 926 views
Hi, I have the following code which generates an Excel document on the fly. I then want to take the file and let the user decide to save it or open it. Dim xls As New ExcelFile Dim fileName As String = xls.Generate() Dim file As New IO.FileInfo(fileName) Response.Clear() Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name) Response.AddHeader("Content-Length", file.Length.ToString()) Response.ContentType = "application/excel" Response.WriteFile(file.FullName) Response.End() When it runs I get the egg timer for a few seconds, then the error message icon in the bottom left of the browser appears. The message is. The data nessessary…
Last reply by Mondeo, -
- 1 reply
- 802 views
I was wondering how to make Intellisense show the descriptions of the methods in my classes, which I make public? It makes it easier for me to use my classes between applications if I don't need to flip back and forth between screens to read what I had put in the comments when I want to use a function in the class. It's more of a quick thing for me, really.. In the long run, if I didn't describe it well enough, I would have to go back to it anyways and read the code. Every little bit helps! Thanks in advance! =) ~Derek Quick Edit: I figure that I should mention that I'm using C# on Visual Studio 2005
Last reply by Fork501, -
- 1 reply
- 689 views
Hi, I'm really not sure whether this is a complete newbie question, or whether I'm a little in the dark on how to send an email in the first place! What I'd like to know is - how do you send an email from code (c#) in Vista? I've tried using the System.Net.Mail namespace and the SmtpClient to send one, but it keeps failing. Would the cause of this be that IIS does not come with an SMTP server in Vista?
Last reply by Fork501, -
- 0 replies
- 2.2k views
I've got a FireFox problem. I have a Menu Navigation Control on a table which is on my masterpage. I have the contentplaceholder in a cell in that same table. Well, no matter what I do i cant get the slide out menus to display ABOVE the stuff in the contentplaceholder, in Firefox. Everything is relatively positioned. I have the z-order set to 9999 for everything but the stuff in the contentplaceholder. In the content pages i have a z-order of 1-99 usually. This is set up like many websites are.. There is a menu to the left side on every page of the website (this is why i did a masterpage). This is possibly the most common setup websites have to tell you the trut…
Last reply by NeuralJack, -
-
- Administrators
- 1 reply
- 2.6k views
Hi there, I'm having trouble starting a very simple Windows Service I created with a System.Threading.Timer. The code is a basic windows service project, with the following lines of note: using System.Threading; public partial class TimerClass: ServiceBase { private Timer _timer; public TimerClass() { InitializeComponent(); } protected override void OnStart(string[] args) { TimerCallback callback = new TimerCallback(OnTimedEvent); _timer = new Timer(callback, null, 10000, 60000); } protected override void OnStop() { // Stop Timer } pr…
Last reply by PlausiblyDamp, -
-
-
- Administrators
- 2 replies
- 1.6k views
We have an application that works fine on our test server, however when we've uploaded it to production it fails. Firstly as part of the logon process it inserts the date into a DB. This gives the following error Arithmetic overflow error converting expression to data type datetime The output of Now.ToString on the test server is 15/06/2007 14:12:26 On the production its 6/15/2007 2:11:52 PM So its using a US date, i've been into regional settings on the web server and that seems fine, everything is set to UK. Various articles on the net seem to suggest that the ASP.NET account has its own regional settings, could that be the problem? If so how…
Last reply by PlausiblyDamp, -
-
- 7 replies
- 1.2k views
I can't use enabled/disabled controls due to requirements for having a user friendly app (they're hard to read and you can't copy/paste from them). So I'm working on a screen where I have duplicate Panels that I hide/show on postback. One has textboxes/dropdowns/etc and the other just displays labels (which are turned into spans) and basically shows up as text.I hate having to duplicate all the data filling and any changes made to one on the other... and I'm thinking of the other 20 screens I have to do this on. I'm just looking for a decent way to get the "here is the readonly mode" and "here is the updatable mode with editable controls". My one thought is t…
Last reply by Eduardo Lorenzo, -
-
- *Experts*
- 2 replies
- 1k views
This is a section of one my my classes which populates itself using a datareader If rdr.HasRows Then rdr.Read() ' get 1st row only Me.vehicleref = CInt(rdr(1)) Me.make = rdr(2).ToString Me.model = rdr(3).ToString Me.IsLimited = CBool(rdr(4)) etc Using the above code I ran into problems if the column in the database was null. The null value couldn't be cast to integer or boolean. So, i changed the code to this. My question is if theres a better, more efficient approach than passing all those object variables around. If rdr.HasRows Then rdr.Read() ' get 1st row only Me.vehicl…
Last reply by Nerseus, -
-
-
- *Experts*
- 5 replies
- 1k views
I have an SQL 2005 table which contains 200 columns, they are mostly money type. Shouild I be concerned about performance with this many fields, would it make sense to split the table up, or is 200 okay in one table? There will be about 20,000 rows. Thanks
Last reply by Nerseus, -
-
-
- Administrators
- 2 replies
- 3.3k views
Currently I have a webform that has DropDownLists populated with specific choices the user can select - problem is he is limited to those choices and cannot enter his own selection (as if he was typing if a free field). I want to provide him the ability to either use the dropdownlist to select one of the predefined options OR type in his own choices (in the same DropDownList) to be used... I knows Forms don't work the same (that is what I am used to) where you can specify what kind of dropdown it is (and one of them allow you to also type in the listbox) - is there such a property or option for the Web Control DropDownList? Is there a way to achieve my goal without bre…
Last reply by PlausiblyDamp, -
-
- 0 replies
- 638 views
I have an Oracle stored proc that fills a DataTable that I then bind to an ASP.NET 2.0 GridView control. This GridView is in an AJAX.NET update panel and I want it to have paging. It also has a button field. When a user clicks the button it flips a checkbox in the same row. If i page I lose the checked boxes. I want to be able to page, maintain the edits the user is making, and then when they mash a button when they are ready, send the edits myself over to oracle. Can't seem to get it done. If i ditch the paging it's a little easier. As the gridview is being bound I create a dataset in view state. When the use mashes the button I loop over the recs in the gridview and …
Last reply by VBAHole22, -
-
- Administrators
- 2 replies
- 661 views
I recently installed SQL Server 2005 Express Edition onto my laptop, didn't want to but I couldn't get SQL 2000 installed on vista. Where is the place to build cubes? Do I have to buy visual studio 2005 in order to work with Analysis Services(BI)?
Last reply by barski, -
-
-
- Administrators
- 7 replies
- 1.6k views
i need to build an application that find PDF's of news paper aditions. the PDF should stay on the installation CD. what is the right way to find/ keep the right path in "any machine"? how can i get the right leeter that any user use for his CD drive... thanks
Last reply by PlausiblyDamp, -
-
-
- Administrators
- 3 replies
- 799 views
Hi When I try to save the html source of my html page inside a microsoft dhtml edit control into an Access .mdb database, I get this error: OleDb.OleDbCommand("INSERT INTO MyOwn (HTMLSource) VALUES ('" + DHTMLEditControl.DocumentHTML + "')", MyConnection) Syntax error in string in query expression ... It should be because of HTML tags, so what should I do? Any help? Thanks.
Last reply by PlausiblyDamp, -
-
-
- Administrators
- 1 reply
- 41.3k views
Quick Guide to Parametrising SQL Jump to the bit on using parameters Often when interacting databases we need to provide information to the database that can only be obtained at runtime (this could be from user input, other programmatic means or similar). Two potential approaches to this problem involve either parametrising the database code or relying on string concatenation. In this post I hope to show why concatenation is bad and parameters are good. To keep things simple I am using the simplest code I can and deliberately ignoring non-essential error handling, for similar reasons I am also choosing not to use stored procedures. I am choosing Northwind as t…
Last reply by PlausiblyDamp, -
-
- 2 replies
- 792 views
I want to use a treeview as a nice organized way to create news headings and then the user can click on the heading to display the news content. But i'm wondering if anyone can confirm that it wont mess up Search Engines. I mean I want the content of each treeview news story to be searched and indexed by the search engines. I guess i'm just wondering if all that code around each article could hinder SE results. Oh also, is it normal for the treeview to make the click noise even if it's not posting back? Mine is, but i did a postback test and it isnt posting back.
Last reply by NeuralJack, -
-
- Administrators
- 2 replies
- 896 views
Hi! I'm new here, and I've picked up a VB project I've been working on for a long time after letting it rot for a year. I'm gonna tell you up front now: I'm pretty much a novice with this, and I'm feeling my way through as I go. So I throw myself at your mercy. :) Anyhow, here's the deal: the app I'm working on is a game-show-style lockout system, and I have an Options screen that the users can access to decide which players use which buttons to buzz in. Basically, you hit a button, it pops up a form asking you to hit the key you want that player to use, and the form closes and sends back the KeyValue of the key. Right now, I have the form displaying that numeric va…
Last reply by clemon79, -
-
-
- Administrators
- 2 replies
- 842 views
Hi guys, I was wondering if anyone knew of a way to prevent the VS IDE from automatically saving my assemblies when I choose 'Build'? Yes, I do realize that saving the source code at the same time that the exe or dll is compiled makes sense. This ensures that they are the same version... But it can also make sense to *not* have this behavior. While VB.NET has background compilation, C# does not. So if using VB.NET, any change that causes a code break is flagged immediately. In C#, however, one is forced to manually chose 'Build' to see if there are any problems... So let's say that I do some sort of complex Regex-based find/replace operation. I'm careful, and …
Last reply by Mike_R, -
-
Who's Online 0 Members, 0 Anonymous, 55 Guests (See full list)
- There are no registered users currently online