|
You could try something like
using System.Collections;
ArrayList ccList=new ArrayList();
ccList.Add("friend@company.com");
mail.CC(ccList);
Luc Pattyn
|
|
|
|
|
I have so many client side validations and same controls r used in .cs file.
if i use javascript asp controls doesnt supprot.
Using view state can i validate on client side.... as he loads the page.
thank u.
|
|
|
|
|
I have so many client side validations and same controls r used in .cs file.
if i use javascript asp controls doesnt supprot.
Could you please tell us more details? I'm not very sure what you meant by "Javascript ASP Controls".
Using view state can i validate on client side....
AFAIK, No. ViewState is not for client-side validation.
as he loads the page.
he? Who?
|
|
|
|
|
i need small and short materials that told me me how to make simple report and how to reterive data from dataset or stored procedures or view and the data is changed depending on the parameter
thanks alot
ma_refay
|
|
|
|
|
i need to know some details about theses pharses
what it's job?
when use it ?
why use it?
**********************************
1- pattrns
2- delegates
3-indexers
4-assembly
ma_refay
|
|
|
|
|
MSDN[^]
Google[^]
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
|
hi every one,
well I wanna validate the data entered in a cell of a DataGridView of a WIndows Application C# 2.0.
I wanted the data to be just numbers u know, no negative numbers or special characters.
I coded some thin like this
private void DataGridView1_KeyPress(object sender, KeyPressEventArgs e)<br />
{<br />
string _allowedkeychars = "1234567890";<br />
if (_allowedkeychars.IndexOf(e.KeyChar) < 0) <br />
{<br />
e.Handled = true;<br />
return;<br />
}<br />
}
but it doesnt disallow the entry of a minus sign or anything other than digits u know. Furthermore, it doesnt give u anything to get to the cell in which the user is editing. So how can I do that, plz help
thanks in advance
Rocky
|
|
|
|
|
Hey Rocky,
In the bit of testing I did the KeyPress event only fires when the cell is not being edited and the key was a Tab key. I've included some code that will do the trick. It's probably not the most cycle efficient but it works.
<br />
private void dataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e)<br />
{<br />
if ( ((DataGridView)sender).CurrentCell == null ) return;<br />
if (((DataGridView)sender).CurrentCell.Value == null) return;<br />
<br />
string str = ((DataGridView)sender).CurrentCell.Value.ToString();<br />
if (this.ContainsOnly(str, "1234567890"))<br />
{<br />
MessageBox.Show("true");<br />
}<br />
else<br />
{<br />
MessageBox.Show("False");<br />
((DataGridView)sender).CurrentCell.Value = null;<br />
}<br />
}<br />
<br />
private bool ContainsOnly(string str, string anyOf)<br />
{<br />
bool result = true;<br />
Char[] str2 = str.ToCharArray();<br />
<br />
for (int i = 0; i < str2.Length; i++)<br />
{<br />
result = result && (anyOf.IndexOfAny(str[i].ToString().ToCharArray()) >= 0);<br />
if (!result) break;<br />
}<br />
<br />
return result;<br />
}<br />
|
|
|
|
|
yea thanks alot I'll try that code in a little while now.
|
|
|
|
|
im using IO and i need to have the program create a text file if it doesnt exsist already. i know its goin to be a if statement but im not sure of much else. any help would be appreciated.
|
|
|
|
|
Take a look at the classes in the System.IO namespace. Their naming is quite intuitive and the documentation contains many examples, so you should be able to figure this out on your own.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
The following will append an existing text file or create a new file if it doesn't already exist:
StreamWriter sw = File.AppendText( "myfile.txt" );
sw.WriteLine( "Blah blah blah..." );
sw.Close();
Hope this helps
Regards
Wayne Phipps
____________
Time is the greatest teacher... unfortunately, it kills all of its students
View my Blog
|
|
|
|
|
Before I even started with C# last year I build some of those... in SS2005AS
I always used Visual Studio to browse them, question is what is best way to implement those things in stand alone application?
Some idea?
|
|
|
|
|
I'm new to C#, so please bear with me on terminology(and spelling). I have a small example application with a form that tries to bind XMLDataDoc instances to a DataGridView. I swap in and out the instances of XMLDataDocs to my DataGridView, depending on which data I’m working with at the time.
My problem is that I can’t seem to control when to actually commit the data to my XMLDataDoc instances. At first when I was learning about binding between DataGridView and XmlDataDoc objects, I thought there was an intrinsic instant updating of the data to the XMLDataDoc when one changes data in the DataGridView, but I’m not able to understand when or where exactly this happens. The commit success is not consistent, in fact I can only get it to happen when add new data to the target row, then click into a new row, and then save.
I’m binding to my DataGridView:
newDataClass1.XmlDataDoc.Load(some_XMLFile_on_a_drive);
BindingSourceVaultItem.DataSource = newDataClass1.XmlDataDoc.DataSet.Tables["ItemColumn"];
DataGridView.DataSource = BindingSourceVaultItem;
If I then create a another XMLDataDoc instance and bind it to the DataGridView:
BindingSourceVaultItem.DataSource = newDataClass2.XmlDataDoc.DataSet.Tables["ItemColumn"];
The DefaultValuesNeeded event populates all the key data, except the itemColumn, which has its column value AutoIncrement set to true. Together, they satisfy my schema rules.
My issue is that after trying to change data within a new row of the DataGridView, and then trying to save data off to an XML file, I receive a “root element” error. I put in a DataGridView.CommitEdit() in the CurrentCellDirtyStateChanged event, in hopes to push the data at the cell level.
Am I using BindSource incorrectly for multiple XMLDataDoc instances? Any help is greatly appreciated and thanks in advance.
|
|
|
|
|
I stumbled onto my idiocy. I did not understand how BindingSource works. I did not realize it was a acting like an additional buffer, just as a DataAdapter does. I simply needed to throw in a BingSource.EndEdit() after my DataGridView.CommitEdit() and whala. I also, not only have a layer of indirection, but a buffer to validate before the real commit to the datasource.
|
|
|
|
|
hello! can anyone teach me how to transfer an audio file from one pc to another using udp? i've tried it myself by transferring the file by blocks however, when the transferring is done, the transferred file is not equivalent to the original file..maybe the some datagrams sent were not able to reach the destination.. how will i handle this?
mumwei
|
|
|
|
|
Hello,
I havent tried through UDP but I have successfully done through TCP packets.
System.IO.FileStream fstream = new System.IO.FileStream(files[j].FullName, System.IO.FileMode.Open, System.IO.FileAccess.Read);
byte[] buffer = new byte[fstream.Length];
fstream.Read(buffer, 0, buffer.Length);
fstream.Close();
//writing to the network stream//
outStream = this.Client.GetStream();
for (int i = 0; i < buffer.Length; i++)
{
//outStream.Write(buffer, 0, buffer.Length);
outStream.WriteByte(buffer[i]);
}
outStream.Close();
You just need to transfer bytes.
Try this and tell me..
Regards ,
nishu
|
|
|
|
|
hi, at last somebody replied to my post..thanks. hmmm... would your recommendation be applicable to realtime audio streaming? my plan actually is to stream the audio packets in real time. since i don't know how to do that yet, i just tried to at least successfully transfer the audio file.yet unfortunately, i wasn't able to..
mumwei
|
|
|
|
|
Hello,
Yes @ clientside thread you receive and can directly play the audio.
Regards ,
nishu
|
|
|
|
|
Hello,
I test through iTunes.I received the bytes from iTunes and was success.
If you have any further question....keep posting..
Regards ,
nishu
|
|
|
|
|
thanks.. but can it handle transferring of way way too large audio files? as in audio files with a span of more than an hour?
mumwei
|
|
|
|
|
Hello,
Correct you should have seperate thread to transfer real time audio file to seperate clients.and you can transfer any length of file as long as your thread got terminate.
Regards ,
nishu
|
|
|
|
|
(If this is not the right forum for this question, please let me know which one).
I need to produce an xml like the following
<customer_list_data>
<customers>
<customer>
<customer_name detail="Customer_1"/>
<customer_status detail="active"/>
</customer>
<customer>
<customer_name detail="Customer_22"/>
<customer_status detail="inactive"/>
</customer>
</customers>
</customer_list_data>
(Notice one extra parent "customer_list_data" above. DataSet seems to have a problem reading in its xsd and properly identifying customer 'table'.)
for which the xsd is:
<xsd:schema targetNameSpace="customerbase"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="customerbase">
<xsd:element name="customers_list_data">
<xsd:complexType>
<xsd:all>
<xsd:element name="customers">
<xsd:complexType>
<xsd:all>
<xsd:element name="customer">
<xsd:complexType>
<xsd:all>
<xsd:element
name="customer_name" minOccurs="1" maxOccurs="1">
<xsd:complexType>
<xsd:attribute name="detail" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
<xsd:element
name="customer_status" minOccurs="1" maxOccurs="1">
<xsd:complexType>
<xsd:attribute name="detail" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
I need a list object in excel that would take user input for a list of:
customer_name, customer_status values.
Note that these correspond to the "detail" attributes of the above xsd, and
Not to the xml text elements.
Now I want to produce an XmlDocument that matches the above xsd, based on
the data filled by the user in the list object.
What is the best way to do that in [ C#, VSTO 2005 SE, Excel 2003 ] ?
Note: Ideally I want to use data binding using this xsd and want an
XmlDocument to be ready already when the user clicks a button in the excel
sheet. I do Not want to use strongly typed datasets.
-- modified at 19:20 Friday 16th February, 2007
|
|
|
|
|
DateTime dateDOB = rdr.GetDateTime(iDOBOrdinal);
It says this is an invalid cast.
When I do this:
DateTime dateDOB = DateTime.Parse(rdr.GetDateTime(iDOBOrdinal));
Is says no method Parse found.
How do I do this?
Thanks for your time!
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|