2,245 Posted Topics

Member Avatar for leoman

[QUOTE=oppiet30;900911]I would like to send mail to myself using a for loop. Like I would like to send email to myself 100 times with a bash shell script. I use to have a script that does this, but I seem to have lost it.[/QUOTE] This thread is over four years …

Member Avatar for KlementHonza
0
2K
Member Avatar for kspriya01

I didn't understand it either. Nice to see we have all the same opinion for once on a thread! :)

Member Avatar for kvprajapati
0
145
Member Avatar for niketan

In .NET the char data type is is 16bit, most other languages it is 8bit. You will also need to watch out for that.

Member Avatar for kvprajapati
0
305
Member Avatar for neerajlad

Are you using an XmlSerializer when this error occurs during runtime, or is this a compile time error? Could you also include the error number. Also check this posting: [url]http://www.dotnetfunda.com/forums/thread146-cs0016-could-not-write-to-output-file-cwindowstemporary-aspn.aspx[/url]

Member Avatar for IdanS
0
638
Member Avatar for mypicturefaded

You're going to need to post code for this I think. I don't understand enough of the problem to help from what you have posted.

Member Avatar for mypicturefaded
0
1K
Member Avatar for phillipdaw

The [icode].Refresh()[/icode] only repains regions of the form that have been invalidated. To force a repaint call [icode].Invalidate()[/icode]. You may only want to invalidate the picture box or wherever you are doing the custom painting. [code=c#] private void button1_Click(object sender, EventArgs e) { this.Invalidate(); } [/code]

Member Avatar for phillipdaw
0
127
Member Avatar for daveofgv

I have implemented the desired behavior in your project. Let me know if this isn't what you were asking.

Member Avatar for sknake
0
1K
Member Avatar for DaveD3

I guess you could use a panel with a lot of buttons so you can get the click appearance minesweeper has and you could switch out button images. I would start with that approach. You're going to want to lay these buttons out with code. Don't use the designer to …

Member Avatar for sknake
0
85
Member Avatar for djzmo

To truly pause an upload you should kill the connection. Another method would be to manually control sending the chunks of data and start sending a minimal amount of data so the transfer is not truly pause but is sending enough data to keep the connection alive. This isn't a …

Member Avatar for sknake
0
110
Member Avatar for papanyquiL

You can't very well convert an XML document in to something "human readable" without knowing the structure of the document. Elements could contain any number of child elements, etc etc. XML by itself is fairly readable if you understand you're looking at related data in my opinion.

Member Avatar for papanyquiL
0
149
Member Avatar for lanepds

export the variable and use $ENV: [code=bash] sk@sk:~$ export MYDATESTAMP="2009-06-25 21:57:18" sk@sk:~$ perl -MDate::Parse -le'print str2time($ENV{"MYDATESTAMP"});' 1245981438 [/code]

Member Avatar for lanepds
0
937
Member Avatar for sismeya

Are you trying to get the PC Name or the DNS Hostname of an IP Address? They are two different things and you will only be able to [b]sometimes[/b] get the pc name if they are on your LAN. If you are trying to get the DNS name of the …

Member Avatar for sknake
0
110
Member Avatar for efontana

The order by should appear in the last query of a union but it applies to [b]ALL[/b] data in the union. You will be ordering all of the queries by the same column. If you want to have the union'd queries ordered by the query order then you could: [code=sql] …

Member Avatar for sknake
0
166
Member Avatar for mathmath

Create a user defined function to do the value mapping and: [code=sql] Update Table Set Column1 = dbo.GetValue('abc'), Column2=dbo.GetValue('def') [/code] Post your complete query here if that doesn't make sense.

Member Avatar for sknake
0
103
Member Avatar for larscla

use: [code=c#] this.Controls.Find("buttonName", true) [/code] It will search for the named control in child containers.

Member Avatar for sknake
0
3K
Member Avatar for devck

What do you mean by "control the flow"? Typically this is called IPC or Inter-Process Communication when you have two applications communicating.

Member Avatar for sknake
0
46
Member Avatar for jonnytabpni

Both the client and server need to be aware of the class definition for the object you will be using. The client and server need to know how to serialize/deserialize the object. You could implement an interface or declare the definitions in a separate DLL and do the business logic …

Member Avatar for sknake
0
133
Member Avatar for Yellowdog428

Instead of calling ExecuteScalar you should open a DataReader and populate a DataTable. [code=c#] private void button1_Click(object sender, EventArgs e) { const string connStr = "Data Source=apex2006sql;Initial Catalog=Leather;Integrated Security=True;"; const string query = "Select * From Invoice Where InvNumber = @InvNumber"; using (DataTable dt = new DataTable()) { using (SqlConnection …

Member Avatar for JerryShaw
0
143
Member Avatar for auhuman

You can get the dictionaries used in open office: [url]http://lingucomponent.openoffice.org/download_dictionary.html[/url]

Member Avatar for auhuman
0
104
Member Avatar for daveofgv

It would also be handy if you posted the error's you are experiencing in this thread. From the looks of it I agree with ddanbe on what it seems like. I would also recommend to stop prefixing your control names with an underscore.

Member Avatar for IdanS
0
141
Member Avatar for IntegrityWebDev

Can you use generics? They are a little easier to deal with than arrays: [code=c#] private void simpleButton2_Click(object sender, EventArgs e) { List<int> free = new List<int>(); List<int> used = new List<int>(); free.AddRange(new int[] { 1, 2, 3, 4, 5, 6 }); used.AddRange(new int[] { 2, 3 }); int nextNumber …

Member Avatar for IntegrityWebDev
0
116
Member Avatar for Corner

Another route is using named pipes if the computers will be on the same LAN. [b]ddanbe[/b]'s suggestion is the most generic and common though, so if you want to play it safe then use tcpip. Named pipes don't play very well on some versions of windows.

Member Avatar for sknake
0
75
Member Avatar for sumitz_31

Use parameterized queries. You will actually be able to read the SQL, prevent SQL injection, and have better performance on the sql server. Here is an example for Sql* but you can change the typename to OleDb and use it the same way: [code=c#] private void simpleButton1_Click(object sender, EventArgs e) …

Member Avatar for sknake
0
96
Member Avatar for sarganaa

[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 frmText : Form { private List<string> _values; public frmText() { InitializeComponent(); _values = new List<string>(); } private void button1_Click(object sender, EventArgs e) { _values.Add(textBox1.Text); textBox1.Clear(); MessageBox.Show(GetLastString()); } …

Member Avatar for sarganaa
0
2K
Member Avatar for havejeet

Indy has an SMTP client you can use to send emails. Here is a sample: [code=delphi] function TEmailFm.SendTestEmail(const aString: String): Boolean; Var aMsg: TIdMessage; aFile: String; begin Result := True; aStringList := TStringList.Create; try aMsg := TIdMessage.Create(Self); aMsg.From.Address := Cfg.eSourceEmail; aMsg.Subject := 'Test E-Mail'; aMsg.Recipients.EMailAddresses := aString; aMsg.Body.Text := 'Test …

Member Avatar for havejeet
0
564
Member Avatar for whitel
Member Avatar for gilbertsavier

I'm afraid I don't understand when this condition occurs. Does it happen when you server is coming up for a reboot or when it is going down? Also can you reliably reproduce the worker process consuming 100% cpu?

Member Avatar for sknake
0
40
Member Avatar for sreeram01

I think this should answer your question: [url]http://www.daniweb.com/forums/thread173903.html[/url] [url]http://support.microsoft.com/kb/329014[/url]

Member Avatar for sknake
0
459
Member Avatar for rockinsteve

If i'm not mistaken one of the parameters to ShellExecute() is the startup path of the process. If this is the only reason for having a shortcut could you not just set the Startup Path with ShellExecute()? I'm not trying to argue or convince you to use another way... I …

Member Avatar for rockinsteve
0
299
Member Avatar for skiabox

A simpler way to do that would be to create a public method in the page and pass the data as a parameter. In the master page: [code=c#] void someClickEvent() { if (Page is pgUserInformation) { ((pgUserInformation)Page).PassParameter("abc"); } } [/code] Replace pgUserInformation with the name of the class from the …

Member Avatar for IdanS
0
930
Member Avatar for sivak
Member Avatar for davidn
0
108
Member Avatar for lqdo

Try this, unwire all of your existing events and wire up these: [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 frmText : Form { public frmText() { InitializeComponent(); textBox1.GotFocus += new EventHandler(textBox1_GotFocus); textBox1.LostFocus += new …

Member Avatar for lqdo
0
111
Member Avatar for mundetas

You would be best off creating an ASP.NET application and moving your logic to a web project. There are software products out there to get form applications online but they're obviously not native and performance/usability suffers. Is there any reason you don't want to do a web project?

Member Avatar for Ramy Mahrous
1
2K
Member Avatar for havejeet

Just call .ToString() with the string formatting options you want. I'm guessing you want year.month.day.hour.minute.sec? Use: I have separated the first code line with .'s for readability. [code=c#] DateTime.Now.ToString("yyyy.MM.dd.HH.mm.ss"); DateTime.Now.ToString("yyyyMMddHHmmss"); [/code]

Member Avatar for havejeet
0
150
Member Avatar for tripes

[code=vb.net] Public Class FormStart Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim readText() As String = System.IO.File.ReadAllLines("C:\file.txt") Dim s As String For Each s In readText Dim columns() As String = s.Split(New [Char]() {","c}) System.Diagnostics.Debugger.Break() Next End Sub End Class [/code]

Member Avatar for Teme64
0
211
Member Avatar for papanyquiL

Which code are you trying to make work -- what you have or what your professor gave you? [code=c#] public sealed class Employeex : ICloneable { public int EmployeeID { get; set; } public string Name { get; set; } public int CurrentLocationID { get; set; } public Employeex() { …

Member Avatar for papanyquiL
0
181
Member Avatar for josu16

You're probably best off creating a dataset and working through that. Add a new DataSet to your project, right click on the dataset designer and add a table adapter, select "New Connection", hit the "Change" button next to the data source text box and select "Microsoft Access Database File (OLE …

Member Avatar for josu16
0
72
Member Avatar for HBMSGuy

So this has nothing to do with files? You have a song stored as binary in the SQL Server and want to use MediaPlayer to play the song, but media player is asking for a URI and you only have a memory buffer? Write out a temporary file.. [url]http://silverlight.net/forums/t/94557.aspx[/url] [url]http://www.iis.net/extensions/SmoothStreaming[/url] …

Member Avatar for HBMSGuy
0
3K
Member Avatar for grvs

1. [code=bash] #!/bin/bash if [ "$1" = "" ]; then echo "usage: $0 [filename]" exit 1 fi if ! test -f $1 then echo "Invalid file name" exit 1 fi chmod u+x $1 [/code] 2. Put the above code in grant.sh, chmod a+x grant.sh, ./grant.sh 3. You can use 'stat' …

Member Avatar for grvs
0
2K
Member Avatar for Gaming wiz

[QUOTE=rockhauler;657950]Vista is ok now. When it first came out there were problems. It always happens like that. It will always be like that. It has always been like that. Nothing changes.[/QUOTE] While that is true it does vary on how many problems there are and what type of problems. With …

Member Avatar for mcsgadgets
0
185
Member Avatar for nmakkena

Here is an example of connecting to an SQL Database, executing a query, and loading a DataTable: [code=c#] private void button1_Click(object sender, EventArgs e) { const string connStr = "Data Source=apex2006sql;Initial Catalog=Leather;Integrated Security=True;"; const string query = "Select * From Invoice Where InvNumber = @InvNumber"; using (DataTable dt = new …

Member Avatar for kvprajapati
0
137
Member Avatar for erictheking1

Looking at the javascript above: This won't detect 4 character TLDs which are valid, such as .mobi or .info: [code] if (domArr[domArr.length-1].length<2 || domArr[domArr.length-1].length>3) { alert("The address must end in a three-letter domain, or two letter country code.") [/code] Here is the function I use for validation but it is …

Member Avatar for sebastian3
0
161
Member Avatar for history84084

You need to escape your query and pass the text value of the combo box, not the literal name. You should also use parameterized queries but that is another discussion. I'm assuming since you gave a multi-part exception that this is being raised by the SQL server and not the …

Member Avatar for tatoba.shejal
0
208
Member Avatar for erictheking1

Why go through the trouble of using Regex? Let the CLR handle validation for you which will solve your invalid pattern error as well: [code=c#] public static bool IsValidEmailAddr(string email) { try { System.Net.Mail.MailAddress addr = new System.Net.Mail.MailAddress(email); } catch { return false; } return true; } [/code] If this …

Member Avatar for sknake
0
327
Member Avatar for Vivek_1986

[QUOTE=adatapost;895972]Here is sql statement: [CODE=VB.NET] Dim sql as String = "select count(*) from tablename" ... [/CODE] It retun zero (0) result when a table is empty.[/QUOTE] Beware -- doing a [icode]Select Count(*)[/icode] from a table locks the entire table and the solution will not scale with multiple users. You will …

Member Avatar for sknake
0
1K
Member Avatar for toykwon

You obviously will want to make sure the control is found, this code will throw an exception if not. [code=c#] private void button1_Click(object sender, EventArgs e) { for (int i1 = 1; i1 <= 15; i1++) { (this.Controls["textBox" + i1.ToString("F0")] as TextBox).Text = "Hello, world"; } } [/code]

Member Avatar for sknake
0
199
Member Avatar for Blaine Tuisee
Member Avatar for travis67

Use the [icode]TreeNode.Tag[/icode] property to store information relating to the tree node. Mock up some container class where you can put file and disk use information and set the node's .Tag property to a reference of it.

Member Avatar for sknake
0
119
Member Avatar for vash47

If a form is shown non-modally using [icode].Show()[/icode] then the CLR will dispose the form if you don't hang on to a reference. Using adatapost's logic should stop the form from being destroyed and you can also located created forms in [icode]Application.OpenForms[/icode]

Member Avatar for vash47
0
112
Member Avatar for xavierantony

Try this: [code=c#] using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace daniweb.console { class Program { static void Main(string[] args) { bool loggedIn = default(bool); while (!loggedIn) { string userName = GetUserName(); //only returns if successful string password = GetPassword(); loggedIn = ValidPassword(userName, password); if (!loggedIn) { Console.WriteLine("Invalid password"); …

Member Avatar for sknake
0
2K

The End.