2,245 Posted Topics
Re: What is [icode]PaintCM[/icode] and why are you instantiating an instance of it in the paint event: [icode]if (PaintCM == new ColorMatrix())[/icode]? I don't understand the conditions which you're trying to change the painting event for really. Try to explain your problem a little more and hopefully we can figure it … | |
Re: As long as you arent changing the "sno" column: [code] Dim cmd As New SqlClient.SqlCommand("Update employees Set Name = @Name, City = @City, Phone = @Phone, Img = @Img Where sno = @sno", con) cmd.Parameters.Add(New SqlClient.SqlParameter("@sno", SqlDbType.Int)).Value = Val(Me.TextBox1.Text) cmd.Parameters.Add(New SqlClient.SqlParameter("@name", SqlDbType.VarChar)).Value = Trim(Me.TextBox2.Text) cmd.Parameters.Add(New SqlClient.SqlParameter("@city", SqlDbType.VarChar)).Value = Trim(Me.TextBox3.Text) cmd.Parameters.Add(New … | |
Re: You can store millions of records in SQL Server easily. You need to create indexes on the fields you intend to search for quick retrieval of records but 30,000 records won't make SQL Server break a sweat. | |
Re: What version of Delphi? For D6 you can use BLOB streams: Saving: [code] procedure TDeliveryInstructionsFm.ButtonUploadClick(Sender: TObject); Var FileName: String; Stream1: TFileStream; Stream2: TStream; begin if OpenDialog1.Execute then begin FileName := OpenDialog1.FileName; if FileExists(FileName) then begin PostAdo.Edit; Stream1 := TFileStream.Create(FileName, fmOpenRead); Stream2 := PostAdo.CreateBlobStream(PostAdoAtlDelivery, bmWrite); Stream2.CopyFrom(Stream1, Stream1.Size); FreeAndNil(Stream1); FreeAndNil(Stream2); PostAdo.Post; DeliveryAdo.Close; … | |
Re: There are plenty of [URL="http://www.codeproject.com/KB/cs/MathParser.aspx"]math parsers[/URL] on the internet if you look around to find one that suits your needs. This is probably going to be too complex for regex unless you're doing very simple equations. [url]http://www.codeproject.com/KB/cs/MathParser.aspx[/url] [url]http://www.c-sharpcorner.com/UploadFile/patricklundin/MathExpParser12062005062213AM/MathExpParser.aspx[/url] [url]http://bytes.com/topic/c-sharp/answers/278940-math-parser[/url] | |
Re: Is this a custom file extension, or are you wanting to add a new handler to a common file extension? Take a look at this article: [url]http://msdn.microsoft.com/en-us/library/bb166549.aspx[/url] You have two registry verbs in addition to what Diamonddrake mentioned. You could create your own file extension and register that file extension … | |
Re: Upload your project. ZIP it up and click the "Go Advanced" then "Manage Attachments" button and upload the ZIP archive. Can you also post the full exception details and indicate in the source where the error is occuring? | |
Re: I would advise creating a macro to insert the desired namespaces automatically. I haven't had much luck modifying visual studios default behavior for new units. | |
Does anyone have an idea why these console colors aren't coming out properly? Some of them work and some come out as junk. [code] using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace daniweb.capp { class Program { static void Main(string[] args) { const string s = "0020002000200020007c007c003a003a007c003a007c007c002000200020002e" + "002d002d002d002d002d002d002d002d002c000d000a0020002000200020007c" … | |
Re: You can also do your loop natively with a [icode]DateTime[/icode]: [code] for (DateTime dt = DateTime.Today; dt < DateTime.Today.AddDays(1); dt = dt.AddMinutes(30)) Console.WriteLine(dt.ToString("hh:mm")); [/code] | |
The "My Favorite Forums" only shows up on the daniweb main page now. Was this part of an update? I liked this navigational ease of showing it on all of the pages. Just my $0.02. | |
Re: This wasn't an easy task. I read the thread and thought it would be an easy answer, but it isn't. The most portable solution I found given the ways to do it is to use hidden columns. Here is how I went about doing it: [code] using System; using System.Collections.Generic; … | |
Re: I understand what you're saying with the document complete event being fired more than once for a navigation, but what are you trying to accomplish? It appears the DocumentComplete event fires for each frame on the site, not for each image downloaded. If you're trying to figure out when the … | |
Re: You may find this code a little easier to work with: [code] private void button1_Click(object sender, EventArgs e) { new Action<Control, string, int>(SetText).BeginInvoke(label1, "Notification Message", 5, null, null); } private void SetText(Control ctrl, string txt, int seconds) { this.Invoke(new MethodInvoker( delegate() { ctrl.Text = txt; })); System.Threading.Thread.Sleep(seconds * 1000); this.Invoke(new … | |
Re: I do not understand what you're asking. That query pulls in all rows from the database so I'm guessing that you are deleting the rows in code? If so you didn't post the code. You can call [icode]DataTable.AcceptChanges()[/icode] to commit all changes made to the datatable. If my guess was … | |
Re: [B]>>1) the data to be stored in ONE location and not 2 different places[/B] You mentioned 6 tables, not 2. [B]>>2) to save disk space[/B] Disk space is minimal [B]>>3) prevent duplicate entries being [/B] Combining those tables will cause more duplicate data If you have transactions on an account … | |
Re: That is object oriented. Non-object oriented would be using static methods -- which does not rely on an instance to execute. Please explain your homework in more detail. Kudos on asking your question by the way. You were up front with saying it was homework and you didn't ask for … | |
Re: Here is an example. This form has 2 RTF boxes and a button: [code] Imports System.Data.SqlClient Imports System.Text Public Class frmRTF Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Const RECORD_ID As Integer = 1000 Dim Sql As New List(Of String) Sql.Add("IF OBJECT_ID('tempdb..##RTF', 'U') IS NOT … | |
Re: You can use LINQ to sort arrays or lists for you. Load up the values from the textboxes in to a collection and call [icode].Sort()[/icode] | |
Re: All of that information is available in [URL="http://msdn.microsoft.com/en-us/library/ms130214.aspx"]SQL Server Books Online[/URL] (BOL). What are you wanting to know exactly? | |
Re: [icode]SqlConnection[/icode] and [icode]SqlCommand[/icode] both implement [icode]IDisposable[/icode] so care should be taking in cleaning up those resources. [code] using System; using System.Data.SqlClient; ... private static int GetInteger() { int result; const string connStr = "Data Source=apex2006sql;Initial Catalog=ServManLeather;Integrated Security=True;"; const string query = @"Select max(column.A) from TBL_table"; using (SqlConnection conn = new … | |
Re: [code] /// <summary> /// /// </summary> /// <param name="FileName"></param> /// <param name="LineNumber">The 0-based line number</param> private static void DeleteLineNumber(string FileName, int LineNumber) { if (!File.Exists(FileName)) throw new FileNotFoundException("File not found.", FileName); if (LineNumber < 0) throw new ArgumentOutOfRangeException("LineNumber", "Must be >= 0"); List<string> lst = File.ReadAllLines(FileName).ToList(); lst.RemoveAt(LineNumber); File.WriteAllLines(FileName, lst.ToArray()); } … | |
Re: You don't want to do that. Typically [icode]Application.StartupPath[/icode] will point to your [icode]C:\Program Files\Vendor Name\Product Name\[/icode] directory. If you write to that directory with Vista or later it will actually redirect the filesystem write to [icode]C:\Users\username\something[/icode] by a process known as [URL="http://support.microsoft.com/kb/927387"]virtualization[/URL]. You should use [icode]Application.UserAppDataPath[/icode] instead for profile-level data … | |
Re: Here is an example of inserting data in to a database using OleDb: [code] public static string BuildExcel2007ConnectionString(string Filename, bool FirstRowContainsHeaders) { return string.Format("Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties=\"Excel 12.0;HDR={1}\";", Filename.Replace("'", "''"), FirstRowContainsHeaders ? "Yes" : "No"); } private static void WriteExcelFile() { string connStr = BuildExcel2007ConnectionString(@"C:\Data\Spreadsheet.xlsx", true); //Note 'rowNumber' is the first … | |
Re: Upload a project demonstrating the issue. If you call BringToFront() and it pumps the message before the window is finished maximizing/restoring sometimes it won't bring the application up front, it will only cause the application to start blinking in the task bar. [edit] The reason I say upload a project … | |
Re: You can do that with a simple query: [code] ALTER TABLE ProjectReCapParameter ALTER COLUMN EngrMultiplier float [/code] Here is a full example using temporary tables: [code] IF OBJECT_ID('tempdb..#ProjectReCapParameter', 'U') IS NOT NULL DROP TABLE #ProjectReCapParameter Create Table #ProjectReCapParameter ( EngrMultiplier int ) Insert Into #ProjectReCapParameter (EngrMultiplier) Values (1) Insert Into … | |
Re: How does your actual code function though? Using the managed API for working with images is [B]very[/B] slow. As far as I know you have to use [icode]unsafe[/icode] regions of code to directly edit an image in-place. You would also want to implement threading in your application. I'm thinking if … | |
Re: Ok here is how I like to do it (personal preference): Here is how to do it from start to finish and keep it all organized for a project named "Daniweb": - File -- New -- Project -- Windows Form App - Check the checkbox for "Create directory for solution" … | |
Re: What type of http client are you using? The exception contains a response where you can pull the HTTP status code from: [code] using System; using System.IO; using System.Net; using System.Windows.Forms; namespace daniweb { public partial class frmHTTP2 : Form { public frmHTTP2() { InitializeComponent(); } private void button1_Click(object sender, … | |
Re: What do you mean by linking a form? You can open the form: [code] private void button1_Click(object sender, EventArgs e) { new frmOtherForm().Show(); } [/code] | |
Re: Why don't you support telnet or SSH communication natively instead of using sendkeys automation? [URL="http://www.csharphelp.com/2006/07/c-telnet-client/"]C# Telnet Client[/URL] | |
Re: Put a windows installation disk in the machine you're trying to install and see if that works. If it does then you might have a driver issue. What type of CDROM is in the Linux machine? I know when SATA drives first came out I had a lot of problems … ![]() | |
![]() | Re: Try this: [code] using System; using System.Text; using System.Windows.Forms; namespace Counter { public partial class Counter : Form { const int MAX_INPUT = 40; const int MAX_A = 42; const int MAX_B = 43; const int MAX_C = 44; const int MAX_D = 45; //a.b.c.d const string fmt_line = @"{0:F0} … ![]() |
Re: Because you're not supposed to do anything with the GUI aside from the application's main thread. There is no reason to. Create your forms and let windows pump messages while you use the [b]thread pool[/b] to execute your processor intensive methods. Manually creating a thread like that is probably a … | |
Re: [B]>>1) The MS SQL Server Express is required to access the data in .mdf files, does the server only need to be installed on the "host" or "server" computer on the network or does it need to be installed on all client computers as well?[/B] You should install the SQL … | |
Re: As mentioned this depends on the client and server. The HTTP protocol has a header field for "Last-Modified" and if the HTTP server in question uses that field, you check for a modification date. You can set the [icode]HttpWebRequest.Method = "HEAD";[/icode] which will only request the http headers for a … | |
Re: Then don't convert the input stream in to an image. Save the raw input stream directly to a file and you will have the exact image they uploaded. [code] //this is a kind of encoding i used byte[] img = Convert.FromBase64String(s); System.IO.File.WriteAllBytes(@"C:\image.bmp", img); [/code] You will obviously have to tweak … | |
Re: You should use [icode]Path.Combine()[/icode] when joining a path string. Be sure to watch out for directories ending with a trailing path delimiter too. The [icode]OpenFileDialog[/icode] is good about well-formed filenames but if you start talking to the registry something you will pull paths back that look like [icode]C:program Files\someDir[/icode] (notice … | |
Re: I'm not sure I understand your design here. It sounds like you're talking about creating a class that inherits from a grid view but it also sounds like you're encapsulating the class. Can you post code samples? | |
Re: I don't understand what you're doing here. Do you have a C# class that you want to convert to VB.NET? Please post the full class for the working language. Also the C# [icode]tyepof()[/icode] operator is called [icode]GetType()[/icode] in VB.NET, but from your code post it looks like you are trying … | |
Re: Download [URL="http://www.wireshark.org/"]Wireshark[/URL] and start sniffing your browser. See if they are using cookies or client-side code to thwart automated downloads. You can watch the browser behavior and reverse engineer it but it can take [B]quite[/B] some time. You could also consider automating mshtml which will is basically a full browser. … | |
Re: You should also take note that in the SQL query you posted you named the column "Days" but in the click event you're not assigning a column name: [code] SELECT DATEDIFF(dd, date_of_arr, date_of_dept) [COLOR="Red"]AS DAYS[/COLOR] [/code] Code (missing column name): [code] da = New SqlDataAdapter("select datediff[COLOR="red"](dd,date_of_arr,date_of_dept) from [/COLOR]guesthouse [/code] It … | |
Re: You can open a file that is in use by another process, you just have to do it slightly different than you normally would: [code] //This gives us access to files that are in use by IIS -- sk using (FileStream fs = new FileStream(FileName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) { using … | |
Re: I have tons of image manipulation code laying around for some document imaging software I did but it uses paid third party libs :( I pointed you to [URL="http://www.getpaint.net/"]Paint.NET[/URL] in a previous thread. Is that not what you wanted? The source is available for it and they have loads of … | |
Re: You should check out the [URL="http://tldp.org/LDP/abs/html/"]Advanced Bash-Scripting Guide[/URL]. | |
Re: You get more tools, features and third party component support with the full blown version of Visual Studio (Microsoft Visual Studio Team System 2008 Development Edition). Just read down the feature checklist and see if the free version does what you want. I have never used Visual Webdeveloper so I … | |
Re: Post the code you have so far. Its more or less like using a socket with buffered read/writes. See [icode]SerialPort.ReadTimeout[/icode] and [icode]SerialPort.WriteTimeout[/icode] for setting the timeout values. | |
Re: [B]>>Create New instance of a class, but use a variable value as name..Possible?[/B] It sounds to me like you're confusing the [icode]Control.Name[/icode] property with the name of a reference in code. In code the name used to reference controls is just used by the developer in the source code but … | |
Re: [code] string[] lines = System.IO.File.ReadAllLines(@"C:\test.txt"); [/code] |
The End.