2,245 Posted Topics
Re: [code=csharp] 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.IO; namespace daniweb { public partial class frmFileStuff : Form { public frmFileStuff() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { const string inFile = @"C:\file.txt"; string outFile = Path.GetTempFileName(); … | |
Re: Try this: [code=c#] string customerId = Request.QueryString["id"]; [/code] | |
Re: [code=delphi] procedure TForm1.Button1Click(Sender: TObject); Var i1, iResult: Integer; begin iResult := 0; for i1 := 2 to 20 do begin if ((i1 mod 2) = 0) then Inc(iResult, i1); end; ShowMessage(IntToStr(iResult)); end; [/code] | |
Re: Add print lines to see if your values are being set properly for @Semester and @AcademicYear See what this turns up: [code=sql] Declare @StudentNo int Set @StudentNo = 12345 -- DECLARE @Semester int DECLARE @AcademicYear int SET @Semester = (SELECT TOP (1) SemesterNo FROM ppu_RegistrationInfo AS ppu_RegistrationInfo_1 WHERE (StudentNo = … | |
Re: No -- you either need to handle the reflection yourself, serialize all the data, or mark the members you want serialized. Here is how you can serialize the data yourself. This is on a form with two buttons: [code=c#] using System; using System.Collections.Generic; using System.IO; using System.Reflection; using System.Windows.Forms; using … | |
Re: I was looking around my profile and I clicked on "All threads started by sknake" and this thread came up: [url]http://www.daniweb.com/forums/thread210944.html[/url] I didn't start that thread -- someone posted a question in the shell scripting or nix software forum and I flagged the post and it was moved. Now somehow … | |
Re: What version of visual studio and .NET framework are you using? | |
Re: This is part of my Project.sln file: [code] Microsoft Visual Studio Solution File, Format Version 10[B].[/B]00 # Visual Studio 2008 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyApp", "[COLOR="red"]MyApp\MyApp.csproj[/COLOR]", "{58F9C679-A58F-4942-AE06-C4B03E398256}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyApp.Core", "[COLOR="Red"]MyApp.Core\MyApp.Core.csproj[/COLOR]", "{DD7B354E-20F2-405C-95BE-67E6E94EBB53}" EndProject [/code] You need to update the fields marked in red above. In this case the projects were housed … | |
Re: On your data adapter check for a property named "ClearBeforeFill" -- I believe it is a designer generated property for typed table adapters. Another solution is to clear the database before you refresh: [code=vb.net] Public Sub loaddata() Try connection.Open() Catch ex As Exception MsgBox(" " & ex.Message) End Try datatable.Clear() … | |
Re: Are you sure the button on your taskbar is not pointed the wrong site? Also can you navigate to the site manually by typing in [url]http://www.hotmail.com/[/url] ? What happens when you try to navigate to the site? | |
![]() | Re: Upload your project. You're not posting the relevant information needed to solve the issue you're having. |
Re: [code=c#] System.Runtime.InteropServices.Marshal.PtrToStringAnsi() [/code] It accepts a pointer and an integer as parameters to read the string [edit] There are many different encoding types for strings, look at all PtrToString(() [/edit] | |
Re: A hash table cannot be serialized but you can move the keys and values over to an array and use the [icode]XmlSerializer[/icode] to get a [icode]byte[][/icode] array and then base64 encode the bytes to send it across the network as string. This should get you started: [code=c#] object[] keys = … | |
Re: Where is [icode]Application.Lock()[/icode] defined at? I have never heard of it. What is it supposed to do? Can you provide some URLs to read about it? | |
Re: You're trying to return the value of multiple select statements in a single stored procedure? | |
Re: Use a timer. [code=csharp] 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 Timer = System.Timers.Timer; namespace daniweb.timer { public partial class frmBlink : Form { private Timer timer; private long syncPoint; public frmBlink() { InitializeComponent(); timer = new Timer(); timer.Interval = … | |
Re: Do you receive an error .... or ? You provided a lot of code but not much information on the behavior of the problem. | |
Re: An example of adding a parameter: [code=c#] using (SqlCommand cmd = new SqlCommand(query, conn)) { cmd.Parameters.Add(new SqlParameter("@Loc", Loc)); cmd.Parameters.Add(new SqlParameter("@Lab", Lab)); cmd.Parameters.Add(new SqlParameter("@Tot", Tot)); return (Convert.ToInt32(cmd.ExecuteScalar()) > 0); } [/code] You are using a variable reference in your query but not giving the variable to the command: [code] strSQL = … | |
Re: Is your app multithreaded -- do you create a new thread, use a timer, or a background worker? If so then all calls to your grid or its underlying datasource should be [icode].Invoke()[/icode]'d instead of running on the non-gui thread. If i'm way off track then I will wait to … | |
Re: Diamonddrake is right here. Why do you want to add a circular reference though? I thought I had cases in the past where it would be useful but after thinking about it I was always able to come up with another library design that would serve the same purpose and … | |
Re: Use a windows form application -- you have more control over the screen painting so you can hide the application borders. As for the BI projects I have no idea, you need to elaborate. | |
Re: You can also store the image in memory: [code=csharp] public partial class frmFormPaint : Form { private Image img; public frmFormPaint() { InitializeComponent(); } protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); if (img != null) e.Graphics.DrawImage(img, 20, 145); } private void button1_Click(object sender, EventArgs e) { img = Image.FromFile(@"C:\picture.bmp"); } … | |
Re: When you create a thread you create it with a callback delegate and when you want to start it you call [icode]thread.Start()[/icode] with an optional object as a parameter for information you want to pass to the thread. If this operation is really as simple as you have indicated it … | |
Re: [url]http://www.asp.net/get-started/[/url] | |
Re: Here is an example TCP client-server application: [url]http://www.codeproject.com/KB/IP/tcpclientserver.aspx[/url] | |
Re: It means you have added them as a contact, or you are friends. Check the users that have a + then check your contact/buddy list: [url]http://www.daniweb.com/forums/profile.php?do=buddylist[/url] | |
Re: [code=csharp] 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.IO; namespace daniweb { public partial class frmRes : Form { public frmRes() { InitializeComponent(); } private void button2_Click(object sender, EventArgs e) { decimal discrimation = 0.75M; string formHeading = "The brown … | |
![]() | |
Re: Tools -- Import and Export Settings -- Reset. You want to "Create a new horizontal tab group" but I don't know how to create it from the IDE. I just reset VS' IDE when it screws up. I gave up trying to customize it because I frequently blow away the … | |
Re: What OS is your computer with two nics running? In Windows I don't believe you can take advantage of it. I have seen Linux setups that can. If you are running a *nix I will run down the links. | |
Re: Change it to this: [code=dos] call getlogs.bat site1 call getlogs.bat site2 [/code] Without the [icode]call[/icode] it will exit after the first call | |
Re: [code=csharp] private void button3_Click(object sender, EventArgs e) { const string fName = @"C:\file.txt"; string txt = @"#redirect to production store" + Environment.NewLine + @"SDPORT=BGIT-SDIRLAUTO:4086" + Environment.NewLine + @"SDCLIENT=CTN610"; if (System.IO.File.Exists(fName)) System.IO.File.Delete(fName); System.IO.File.WriteAllText(@"C:\File.txt", txt); } [/code] | |
Re: So if you use Visual Studio to run the app on the pocket PC you do not get an error? But if you build an installer you do get an error? | |
Re: [code=csharp] using System.Runtime.InteropServices; // DllImport using System.Security.Principal; // WindowsImpersonationContext using System.Security.Permissions; // PermissionSetAttribute ... public WindowsImpersonationContext ImpersonateUser(string sUsername, string sDomain, string sPassword) { // initialize tokens IntPtr pExistingTokenHandle = new IntPtr(0); IntPtr pDuplicateTokenHandle = new IntPtr(0); pExistingTokenHandle = IntPtr.Zero; pDuplicateTokenHandle = IntPtr.Zero; // if domain name was blank, assume local … | |
Re: Which query is giving you the error -- you have two? Also can you please post the exception you're receiving? | |
Re: Does this only happen in RELEASE mode when you build the installers or does it happen all of the time? Do the projects have references to each other as "Project References" and not referencing their DLL output? The primary output of a project is a single DLL or EXE -- … | |
Re: Can you post the error messages you are receiving? It might be a parsing error versus disk corruption issue. We need more information. | |
| |
Re: That all depends on what your final query is evaluated as. We can't see what your user input is. One piece of advise: [b]use parameterized queries![/b] [url]http://forums.devx.com/showthread.php?t=160026[/url] Put a break point on the line [icode]com.ExecuteNonQuery()[/icode] and evaluate the value of [icode]com.CommandText[/icode] and post it back here. | |
Re: densman: You posted this question in the VB.NET forum. VB 4,5,6 question are in a different forum: [url]http://www.daniweb.com/forums/forum4.html[/url] [b]Please[/b] do not create another thread for this. A moderator will be along shortly to move the thread for you. elangosugi: You also posted a VB5 question in the .NET forum, and … | |
Re: That is unfortunate. Why don't you post the query and related code to the update so we can see where the problem may exist? | |
Re: Do you mean you want to draw a rectangle around area that have all-white pixels? This will work OK if the areas are in fact only rectangular but I highly suspect you will find jagged edges with white pixels. How should that be handled? | |
Re: You may consider using [icode]Path.Combine()[/icode] when assembling full paths :) -- it can help if you're unsure that the first directory path ends with a path delimiter. | |
Re: I have also done something similar and posted the code in C#. However the real work is all done by reading a [icode]DataTable[/icode] from OleDbCommand, OleDbConnection, OleDbDatatReader, etc. so you can modify it for any oledb accessible data. [url]http://www.daniweb.com/forums/thread221141.html[/url] | |
Re: Form1: [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.formtalking { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { Form2 frm = FindOpenForm2(); if (frm != null) frm.SetText(textBox1.Text); } … | |
Re: I suspect danny is right... we don't know what ClickPic is Here is code to center a control and a call to suspend the layout to reduce screen flicker [code=csharp] private void button4_Click(object sender, EventArgs e) { this.button4.SuspendLayout(); button4.Left = (this.Width - this.button4.Width) / 2; button4.Top = (this.Height - this.button4.Height) … | |
Re: Some people have other ways but I have had problems doing it any way except this way. Assume we have two projects: "Source Project" and "Destination Project". The source project contains the form we want to copy to the destination project. In the destination project create a new form with … | |
Re: Try this out Here is the meat of what you're requesting (I think): [code=c#] using System; using System.Windows.Forms; using Timer = System.Timers.Timer; namespace daniweb.timer { public partial class frmSystemTime : Form { private Timer timer; public frmSystemTime() { InitializeComponent(); timer = new Timer(); timer.Interval = (1000 * 1); //1 sec … |
The End.