2,245 Posted Topics

Member Avatar for Diamonddrake

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 …

Member Avatar for Diamonddrake
0
514
Member Avatar for tqmd1

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 …

Member Avatar for sknake
0
109
Member Avatar for dskumar_85

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.

Member Avatar for sknake
0
67
Member Avatar for leon777

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; …

Member Avatar for sknake
0
139
Member Avatar for NargalaX

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]

Member Avatar for sknake
0
111
Member Avatar for apease11

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 …

Member Avatar for sknake
0
142
Member Avatar for oufa
Re: hi

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?

Member Avatar for sknake
0
123
Member Avatar for farag

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.

Member Avatar for sknake
0
153
Member Avatar for sknake

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" …

Member Avatar for sknake
2
357
Member Avatar for Mitja Bonca

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]

Member Avatar for Mitja Bonca
0
140
Member Avatar for sknake

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.

Member Avatar for sknake
2
430
Member Avatar for gisek

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; …

Member Avatar for gisek
0
3K
Member Avatar for Gixxer98226

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 …

Member Avatar for sknake
0
152
Member Avatar for Mitja Bonca

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 …

Member Avatar for sknake
0
166
Member Avatar for eeyc

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 …

Member Avatar for eeyc
0
442
Member Avatar for badmanmc

[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 …

Member Avatar for jmw229
0
154
Member Avatar for lowhzplayinfool

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 …

Member Avatar for lowhzplayinfool
2
313
Member Avatar for scias23

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 …

Member Avatar for sknake
0
575
Member Avatar for theresonly1ash

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]

Member Avatar for sknake
0
117
Member Avatar for nani02

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?

Member Avatar for sknake
0
33
Member Avatar for mahmud.riyadh

[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 …

Member Avatar for sknake
0
101
Member Avatar for Karthika_g

[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()); } …

Member Avatar for sknake
0
75
Member Avatar for jbennet
Member Avatar for saj_amo

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 …

Member Avatar for saj_amo
0
1K
Member Avatar for szkoda

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 …

Member Avatar for sknake
0
298
Member Avatar for Dmennite

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 …

Member Avatar for Dmennite
0
4K
Member Avatar for SQL2009

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 …

Member Avatar for DanielGreen
0
6K
Member Avatar for Diamonddrake

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 …

Member Avatar for Diamonddrake
0
146
Member Avatar for TotoTitus

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" …

Member Avatar for TotoTitus
0
79
Member Avatar for ramkinkarpandey

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, …

Member Avatar for sknake
0
146
Member Avatar for PROTEUS GREEK

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]

Member Avatar for sknake
0
103
Member Avatar for Deepak.G

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]

Member Avatar for sknake
0
645
Member Avatar for psrajeshece

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 …

Member Avatar for nileshgr
0
149
Member Avatar for kobalt

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} …

Member Avatar for kobalt
0
104
Member Avatar for MxDev

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 …

Member Avatar for sknake
0
166
Member Avatar for zachattack05

[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 …

Member Avatar for zachattack05
0
401
Member Avatar for Gixxer98226

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 …

Member Avatar for Gixxer98226
0
114
Member Avatar for TotoTitus

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 …

Member Avatar for TotoTitus
0
10K
Member Avatar for Dmennite

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 …

Member Avatar for sknake
0
96
Member Avatar for Geekitygeek

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?

Member Avatar for sknake
0
195
Member Avatar for jamieslucky7

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 …

Member Avatar for sknake
0
87
Member Avatar for doncev

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. …

Member Avatar for sknake
0
94
Member Avatar for kanuri1

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 …

Member Avatar for sknake
0
79
Member Avatar for pardeep3dec

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 …

Member Avatar for Medalgod
0
100
Member Avatar for Diamonddrake

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 …

Member Avatar for Diamonddrake
0
111
Member Avatar for tech291083

You should check out the [URL="http://tldp.org/LDP/abs/html/"]Advanced Bash-Scripting Guide[/URL].

Member Avatar for tech291083
0
88
Member Avatar for DGentry

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 …

Member Avatar for DGentry
0
92
Member Avatar for Fire_Michel

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.

Member Avatar for Fire_Michel
0
109
Member Avatar for Meinsamr

[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 …

Member Avatar for ddanbe
0
187
Member Avatar for stanmore88

[code] string[] lines = System.IO.File.ReadAllLines(@"C:\test.txt"); [/code]

Member Avatar for sknake
0
94

The End.