2,245 Posted Topics
Re: Try this: [code=c#] using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace daniweb { public partial class frmPanel : Form { private Point start; public frmPanel() { InitializeComponent(); } private void panel1_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { start … | |
Re: That doesn't compile in 3.5 and I think the error message answers your question: [code=text] 'daniweb.MyClass.MyClass()' must declare a body because it is not marked abstract, extern, or partial 'daniweb.MyClass.MyClass(string)' must declare a body because it is not marked abstract, extern, or partial [/code] Interfaces allow you to declare methods … | |
Re: You can also use [icode]Uri[/icode] [code=csharp] private void button3_Click(object sender, EventArgs e) { string baseDir = IncludeTrailingPathDelimiter(Environment.CurrentDirectory); const string arg = @"..\"; Uri baseUri = new Uri(baseDir, UriKind.Absolute); Uri resolvedUri = new Uri(baseUri, arg); Console.WriteLine(string.Format("CWD : '{0}'", baseUri.LocalPath)); Console.WriteLine(string.Format("arg : '{0}'", arg)); Console.WriteLine(string.Format("Combined: '{0}'", resolvedUri.LocalPath)); System.Diagnostics.Debugger.Break(); } private static string … | |
Re: What is the value of [icode]drv["OurRating"][/icode] when that exception occurs? Interestingly enough I have never seen [icode]System.Number.StringToNumber[/icode] fail before when parsing values so I looked around and it seems there is an odd bug. [url]http://groups.google.com/group/microsoft.public.dotnet.framework/browse_frm/thread/1e2a5a340425a67b/9eb8e300c7c60821[/url] It links to a Microsoft feedback report: [url]https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=253265[/url] [quote] Posted by Microsoft on 3/22/2007 at … | |
Re: The only downside to doing it with [icode]Year()[/icode] on the search column is indexes wont be used since you're running a function on the column you want to search on. Ideally you should use date ranges wherever possible. But cgyrob was awesome and gave you the solution using between() so … | |
Re: Line 44 in your first post -- Shouldn't that be [icode]> 0[/icode]? Upload a sample project and i'll take a look at it. | |
Re: [QUOTE=eben_ezer32;1105009]what can i do to to create own webpage?[/QUOTE] [B]eben_ezer[/B]: You should create your own thread to ask questions, not ask on someone elses thread. Check out the [URL="http://www.daniweb.com/forums/forum18.html"]ASP.NET forum[/URL]. [B]wayneww[/B]: This is really an SQL question. In the future please ask query questions in the [URL="http://www.daniweb.com/forums/forum127.html"]MSSQL forum[/URL]. To answer … | |
Re: [B]>>Erm, do I need Visual Studio in my Windows Server 2008 to make my website work? [/B] No [B]>>Somehow,I've set my Content Directory and my Visual Directory to the same folder with all my ASP.NET pages + codes inside but it doesn't work at all[/B] Visual directory? Do you mean … | |
Re: Yes you can read the contents of a .NET assembly with Redgate's .NET reflector. You can even decompile a VB.NET app in to C# -- as when you compile either language it is turned in to MSIL. For getting around it you can make it difficult or use unmanaged encryption … | |
Re: You should be able to iterate through 872 lines in no time. You still have to read the line in to memory and search for a carriage return to count the line numbers. Without knowing the byte position of where you want the streem to seek to then you really … | |
Re: There is no overload of [icode]StreamWriter(stream, append)[/icode] because the "append" property is specified when you create the stream. [code] Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Dim fs As New FileStream("scores.txt", FileMode.Create, FileAccess.Write) Dim s As New System.IO.StreamWriter(fs) 'This gets the file create/append properties from … | |
Re: Can you upload the project demonstrating the problem? That looks rather complicated from the code you posted ;) Also did you [URL="http://www.getpaint.net/"]Paint.NET[/URL] was [URL="http://blog.getpaint.net/2007/12/15/paintnet-v320-source-code-now-available/"]open source[/URL]? It is a fairly advanced image manipulation program. | |
Re: You should consider using "date tables". This sort-of breaks the rules for storing data that could be calculated but when dealing with dates like this I find it to be a better solution. Create a table that stores the dates for each events and write a piece of code to … | |
Re: Here is the SQL Statements for backing up and restoring with TSQL. You should also be able to use the Microsoft SQL Management Studio if that option was selected when you installed MSDE. [code=sql] --First create a backup BACKUP DATABASE [Leather] TO DISK = N'C:\Program Files\Microsoft SQL Server\MSSQL\BackUpManual\Leather.bak' WITH INIT … | |
Re: Saving arrays in a database as any kind of delimited field is usually not a good idea. The point of databases is [URL="http://en.wikipedia.org/wiki/Database_normalization"]normalization[/URL]. Why don't you save the array as individual rows in a detail table and join it to the primary table? The implementation of that depends on which … | |
Re: Take a look at Developer Express controls. They have a skinnable control suite that looks awesome. Here is a link to some screenshots: [url]http://www.devexpress.com/Products/NET/Controls/WinForms/Skins/[/url] Its not free but its worth it. | |
Re: [ICODE]GEOMETRY[/ICODE] & [ICODE]GEOGRAPHY[/ICODE] are new data types to sql 2008, not sql 2005. SQL Server 2008R2 is out and has a free express edition which also raised the DB cap from 4GB to 8GB. I would suggest upgrading or creating columns for each field of geometry. | |
Re: That isn't necessarily a good idea. You can run in to problems with frames/cookies/shared application states/etc. Did you write the applications or can you integrate them on the back end? What webserver and what type of application are you dealing with? | |
Re: If you want to disable the mouse for a single control/single form: [code] using System; using System.Windows.Forms; namespace daniweb { public partial class frmMouseWheel : Form { public frmMouseWheel() { InitializeComponent(); } protected override bool ProcessKeyPreview(ref Message m) { //return false: normal behavior for forwarding message to the control //return … | |
Re: Take a look at [URL="http://www.getpaint.net/"]Paint.NET (www.getpaint.net)[/URL]. It is more or less like photoshop and written in .NET. Previously it was open source so if you hunt around the net you should be able to turn up an old copy of their source. It has a lot of image manipulation code. | |
Re: For versions before Excel 2007 use [URL="http://npoi.codeplex.com/"]NPOI[/URL]. For Excel 2007 use the [URL="http://msdn.microsoft.com/en-us/library/bb448854(office.14).aspx"]Microsoft Open XML SDK[/URL]. You can edit office files natively (finally) from a Microsoft SDK. | |
Re: This query copies the table "madExcept" from the "Bugs" database to the "ShotgunHill" database: [code=sql] Select * Into ShotgunHill..madExcept From Bugs..madExcept [/code] Doing this does not recreate the table properly in the destination database though. Many table constraints, such as Primary Key, will not be set up properly when you … | |
Re: [B]>>My guess is that the different parts of the webpage are coming from different servers, thus the various connections...[/B] You are correct... not much else to add. When you visit a webpage, say cnn.com, it could reference images from facebook.com or imageshack.com. There are also websites that run trash javascript … | |
Re: Try this.... [code] using System; using System.IO; using System.Net; using System.Text; using System.Windows.Forms; namespace daniweb { public partial class frmESL : Form { static CookieContainer container; const string username = @"user@name.com"; const string password = @"password"; public frmESL() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { string s … | |
Re: [code] Update SpecialTable Set Rows = dbo.GetRows(SpecialTable.Id) [/code] | |
Re: Can you upload a sample project demonstrating this behavior? And by known type are you referring to types in a [icode]KnownType[/icode] attribute or primitive types in the BCL? Which WCF serializer are you using? etc etc. | |
Re: You're on the right track. By default when you add new controls via the IDE the [icode]Modifiers[/icode] property is set to private. Open your user control in the IDE and change the [icode]Modifiers[/icode] to [icode]Public[/icode] for any control you want to reference in forms where you are using your user … | |
Re: Take a look at line 19. Calling [icode]Invalidate()[/icode] will cause the entire form to be redrawn (including the background image) when you're moving the mouse. Comment out that line entirely and let the form paint itself. | |
Re: "VB.NET doesn't support multi-statement lambda expressions or anonymous methods." [url]http://social.msdn.microsoft.com/Forums/en-US/linqprojectgeneral/thread/9f6733c3-32ad-4b84-b393-029913e7243a[/url] As adatapost advised, use AddHandler. | |
Re: I have posted a code snippet for a sample login screen that includes encrypt/decrypt: [url]http://www.daniweb.com/code/snippet217409.html[/url] [code] /// <summary> /// Key for the crypto provider /// </summary> private static readonly byte[] _key = { 0xA1, 0xF1, 0xA6, 0xBB, 0xA2, 0x5A, 0x37, 0x6F, 0x81, 0x2E, 0x17, 0x41, 0x72, 0x2C, 0x43, 0x27 }; … | |
Re: You could create a script: [code] #!/bin/bash ftp -n 10.2.1.2 <<! user "username" "password" put /tmp/upload.txt upload.txt bye ! [/code] Sample usage: [code=text] sk@svn2:/tmp$ cat ftp.sh #!/bin/bash ftp -n 10.2.1.2 <<! user "username" "password" put /tmp/upload.txt upload.txt bye ! sk@svn2:/tmp$ ./ftp.sh [/code] | |
Re: Here is an example in C# [code=c#] private void SetTableList(string factoryName) { try { DbProviderFactory factory = DbProviderFactories.GetFactory(factoryName); using (DbConnection connection = factory.CreateConnection()) { connection.ConnectionString = _conn.ConnectionString; connection.Open(); _dtTables = connection.GetSchema("Tables"); _dtColumns = connection.GetSchema("Columns"); List<string> Sql = new List<string>(); for (int i1 = 0; i1 < _dtTables.Rows.Count; i1++) { string … | |
Re: You can run mixed versions of SQL to a certain extend but I would not recommend it, unless unavoidable. Download the appropriate installer: [URL="http://download.microsoft.com/download/5/5/8/558522E0-2150-47E2-8F52-FF4D9C3645DF/SQLEXPRWT_x64_ENU.exe"]x64 - SQLEXPRWT_x64_ENU.exe[/URL] [URL="http://download.microsoft.com/download/5/5/8/558522E0-2150-47E2-8F52-FF4D9C3645DF/SQLEXPRWT_x86_ENU.exe"]x86 - SQLEXPRWT_x86_ENU.exe[/URL] Make sure you have installed the pre-requisits: [URL="http://download.microsoft.com/download/2/0/e/20e90413-712f-438c-988e-fdaa79a8ac3d/dotnetfx35.exe"].NET Framework 3.5 SP1[/URL] [B]Windows 7[/B] •Windows Powershell 1.0 - Included with OS •Windows … | |
Re: I have posted a design approach in your other (similar) thread: [url]http://www.daniweb.com/forums/thread286944.html[/url] | |
Re: I would flip this design around a little bit. Creating a timer consumes resources so instead of creating 6 timers for 6 cameras, creating 1 timer and have it launch the download code in another thread. I would also recommend using threadpool threads instead of manually creating a thread. Here … | |
Re: [B]>>ACtually in the end I am going to use the Multimedia Timer (it's the most precise).[/B] I have always been under the impression that Stopwatch was the most accurate .NET timer, but it seems you're right. Thanks for posting that. Anyway I wanted to mention if you're writing an application … | |
Re: Eh... I thought the format for domain user accounts was [icode]DOMAIN\Username[/icode]. Apply the desired ACL rules in windows explorer then write code to dump out all access rules. Compare the ACL before/after the permission change and you will have your answer... Also you could be inheriting deny permissions while explicitly … | |
Re: Please post SQL questions in the SQL forums. Also check out [URL="http://msdn.microsoft.com/en-us/library/ms188059.aspx"]Microsoft's books online[/URL] for help with TSQL syntax. Syntax: [code=text] SET IDENTITY_INSERT [ database_name . [ schema_name ] . ] table { ON | OFF } [/code] Example Usage: [code=sql] SET IDENTITY_INSERT tempdb.dbo.#Temp ON [/code] Runnable Example: [code=sql] IF … | |
Re: Your best bet with getting started is downloading [URL="http://www.wireshark.org/"]wireshark[/URL] and sniffing an FTP session you control. As you move around and execute tasks on the FTP session you will see the command request/reponses. As you begin to get more familiar with FTP you can take a stab at reading the … | |
Re: Please post SQL questions in the [URL="http://www.daniweb.com/forums/forum127.html"]MS SQL Forum[/URL] To answer your question: [code=sql] CREATE FUNCTION getRows ( @id int ) RETURNS int AS BEGIN DECLARE @rownums int Set @rownums = IsNull((SELECT Count(*) FROM dbo.MainData (NOLOCK) where id=@id), 0) RETURN @rownums END [/code] | |
Re: >>So I tried to access web through [url]http://192.168.0.100/[/url]... >>Problem persists. Initial phpmyadmin screen comes up, but the >> as I enter the main database part the screen hangs. When you navigate to [icode]http://192.168.0.100/[/icode] and click on a subsequent link is are you being redirected to [icode]http://192.168.0.100/somePage[/icode] or [icode]http://localhost/somePage[/icode]. If the … | |
Re: [icode]wget[/icode] is intended to download remote files via the command line, so what you're explaining is the expected behavior. The [icode]-o[/icode] option is for logging output, where the [icode]-O[/icode] option is for file output. If you're just wanting to download a file but throw all data away then use something … | |
Re: Here is one way to go about it. This code doesn't validate if you select a secondary value then change the primary value... you will want to handle that situation. [code] using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Diagnostics; namespace … | |
Re: You don't want to. Keep your current design. | |
Re: Developer Express also has a control for this (XtraWizard): [url]http://www.devexpress.com/Products/NET/Controls/WinForms/Wizard/[/url] Its well worth the purchase price | |
Re: Install a service and watch for new processes starting up. Unfortunately the behavior you're describing is commonly used by spyware/malware programs so this will probably set off antivirus apps if you try to natively "link" the programs in the registry, but it is possible (and i wont answer any questions … | |
Re: Take a look at this article: [url]http://www.codeproject.com/kb/asp/request_server_variables.aspx[/url] AUTH_USER [quote] The name of the user as it is derived from the authorization header sent by the client, before the user name is mapped to a Windows account. This variable is no different from REMOTE_USER. If you have an authentication filter installed … | |
Re: Do you want to programmatically switch out their captions or move each label on the form? |
The End.