Ramy Mahrous 401 Postaholic Featured Poster

Thanks, Scott.
Scholar, no. It's my fault I didn't note that newlabel.Name = s1; let it newlabel.Name = "name" + i;

Ramy Mahrous 401 Postaholic Featured Poster

I think you just need to change the ShowMessage() to show the .Name property instead of .Text, try this:

WHAT :) I think they should overcome this!!!

sknake commented: you would think but thats obviously not the case ;) +2
Ramy Mahrous 401 Postaholic Featured Poster

Look, I'll give you simple code
Simply when button clicked It add new label and once the created label clicked; message box shown with its Name and its Text

Label newlabel;
void BtbAddLabel_Click(object sender, EventArgs)
{
newlabel = new Label();
newlabel.AutoSize = true;
newlabel.Text = s1;
newlabel.Location = new System.Drawing.Point(50, 20+30*i);
newlabel.Name = s1;
newlabel.Size=new System.Drawing.Size(60,25);
newlabel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
newlabel.Click+=new EventHandler(LabelClick);
groupBox1.Controls.Add(newlabel);
}
void LabelClick(object sender, EventArgs)
{
MessageBox.Show( ((Label)sender).Name+ " " + ((Label)sender).Text);
}
Ramy Mahrous 401 Postaholic Featured Poster

Please again clarify your request with simple scenario.

Ramy Mahrous 401 Postaholic Featured Poster

If you did a blog post explaining the solution, I'll give you everyday points for 3 days mine is 7 ;)

Ramy Mahrous 401 Postaholic Featured Poster

Please send the full code, I'm sure it should get the desired output.

Ramy Mahrous 401 Postaholic Featured Poster

If you save file I recommend you to use

Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);

Another solution if your organization does like mine, locate Desktop, Documents and so on on network location you may be disconnected or something in network please check that with your network administrators.

Ramy Mahrous 401 Postaholic Featured Poster
foreach (string s1 in s2)
            {
                newlabel = new Label();
                newlabel.AutoSize = true;
                newlabel.Text = s1;
                newlabel.Location = new System.Drawing.Point(50, 20+30*i);
                newlabel.Name = s1;
                newlabel.Size=new System.Drawing.Size(60,25);
              
                newlabel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
                groupBox1.Controls.Add(newlabel);

//event handler
newlabel.Click+=new EventHandler(LabelClick);
                i++;
            }
void LabelClick(object sender, EventArgs)
{
MessageBox.Show( ((Label)sender).Text);
}
Ramy Mahrous 401 Postaholic Featured Poster

Who said it being disposed?! (we've clarified above) cmd=Null; you made it refers to null which gets exception Object reference not set to an instance of an object.

Ramy Mahrous 401 Postaholic Featured Poster

hehehehehee extraordinaryyyyyyyyyyyyyyyyyyyyyyyyyyyy

serkan sendur commented: this is an advance credit, think about it man, ten days.. +4
Ramy Mahrous 401 Postaholic Featured Poster

Thanks, Scott :) you saved my time a lot.

Ramy Mahrous 401 Postaholic Featured Poster

I love your character, Serkan really :)
I'll try that and if I could, I'll tell you.

Ramy Mahrous 401 Postaholic Featured Poster

Serkan you're developing not just playing :) in sometimes I need to compare a lot of files dozens of files what makes me hear if I need to know if file hasn't the full track and some dozens of reasons I've to compare by the signals. they just can take the most proper solution mine or yours.

Ramy Mahrous 401 Postaholic Featured Poster

I don't see any need to know the name of TextBox because what differentiates one on one is the last number => TextBox1 and TextBox2 so I've button AddTextBox which creates and adds new TextBox

List<TextBox> TextBoxesLst = new List<TextBox>();
void AddTextBox_Click(...)
{
if(TextBoxesLst.Count < 10)
{
TextBoxesLst.Add(new TextBox());
//some UI procedures....
}
}
void SetText(int textBoxNumber, string text)
{
TextBoxesLst[textBoxNumber].Text = text;
}
Ramy Mahrous 401 Postaholic Featured Poster

Bravo Serkan but
1- If the different in the last byte
2- I have program to convert to different types the input was file and it produces .mp3 and .wmv your program should say they are identical because when you compare strings you compare characters and when you compare sounds you compare signals.

Ramy Mahrous 401 Postaholic Featured Poster

If you have big identical in size audio files 10+ MB it's not good to compare files + what about if files in different format?? how to compare + MATLAB researchers really do great work in such field in performance perspective and so on.

Ramy Mahrous 401 Postaholic Featured Poster

People sharing some ideas http://bytes.com/groups/net-c/274659-audio-recording-c-how
My personal opinion is to work on MATLAB (saving time, a lot of implemented algorithms, etc...) then call it from C#
MATLAB gives dll->use it from C#

Ramy Mahrous 401 Postaholic Featured Poster

I don't have specific solution but try to ask in MySQL forum http://www.daniweb.com/forums/forum126.html or just something got to my mind is to open visual studio as administrator.

Ramy Mahrous 401 Postaholic Featured Poster

WorkSheet.... because you use COM, which you didn't terminate it yourself and if you open the task manager you will see Test10.exe is running. Try adatapost help it solves your problem

Ramy Mahrous 401 Postaholic Featured Poster
Ramy Mahrous 401 Postaholic Featured Poster

I like to inform you that if moderators read these replies they will grade down our points (Daniweb moderators aren't loyal to anyone even you C# solvers :D)

Ramy Mahrous 401 Postaholic Featured Poster

loooooooooool, How lucky I'm :D I came to here by chance as I found very interested subject C#. I agree with you guys I didn't understand it :D

Ramy Mahrous 401 Postaholic Featured Poster

Here you are

/* \r\n or just \n depending from where you got data text file or something esle \r*/
string[] lines = richTextBox1.Text.Split(new string[]{"\r\n"}, StringSplitOptions.None);
//you need, say to select first 3000 lines
for(int i=0; i<3000; i++)
{
richTextBox1.Append(lines[i]);
}
Ramy Mahrous 401 Postaholic Featured Poster

Once a time I was searching and I didn't find any free one. you can search yourself and see.

Ramy Mahrous 401 Postaholic Featured Poster

I became old man who doesn't remember code syntax :(

int result;
if(int.TryParse(TextBox1.Text, out result))
MessageBox.Show(stirng.Format("Result is {0}", result));
else
MessageBox.Show("Text couldn't be converted to integer");
Ramy Mahrous 401 Postaholic Featured Poster

Sometimes, but you must answer\put work around in a blog to make it easier for whom they come after.

Ramy Mahrous 401 Postaholic Featured Poster

Here you are

if(int.TryParse(TextBox1.Text))
//good
else
MessageBox.Show("Text couldn't be converted to integer");
Ramy Mahrous 401 Postaholic Featured Poster

You should work with SqlCacheDependency once a table affected event fired and you rebind data
http://msdn.microsoft.com/en-us/library/system.web.caching.sqlcachedependency.aspx

Ramy Mahrous 401 Postaholic Featured Poster

Can you please send code snippet it may help us to understand your well.

Ramy Mahrous 401 Postaholic Featured Poster

There're techniques the most fit I don't know you should read the pros\cons and determine the most suitable for you
1- WCF
2- MSMQ
3- .NET Remoting
4- COM

Ramy Mahrous 401 Postaholic Featured Poster

I knew it I knew it, YOU CAN'T call disposed explicit in your code, because to dispose the component your should by pass bool to true and the dispose method which has parameter (bool) is protected which means SqlCommand itself in specific time call it.

Ramy Mahrous 401 Postaholic Featured Poster

SqlCommand inherits from DBCommand which inherits from Component
Component has this implmenetation of Dispose

protected virtual void Dispose(bool disposing)
{
    if (disposing)
    {
        lock (this)
        {
            if ((this.site != null) && (this.site.Container != null))
            {
                this.site.Container.Remove(this);
            }
            if (this.events != null)
            {
                EventHandler handler = (EventHandler) this.events[EventDisposed];
                if (handler != null)
                {
                    handler(this, EventArgs.Empty);
                }
            }
        }
    }
}

I couldn't figure out those lines and I have to catch every line and know where and what to call, so I added that to my to do list :)

Ramy Mahrous 401 Postaholic Featured Poster

Yes I say it inherits from DBCommand and overrides Dispose method

sknake commented: I meant to thank you for posting about .net decompilers +2
Ramy Mahrous 401 Postaholic Featured Poster

SqlCommand doesn't implement IDisposable but DBCommand does,

SqlCommand inherits from DBCommand

ddanbe commented: Nice remark! +6
Ramy Mahrous 401 Postaholic Featured Poster

I'm not going to give quick solution because I couldn't review your code, so I suggest to use your true eyes F5; debug the application and but break points it'd lead you to the logic error.

Ramy Mahrous 401 Postaholic Featured Poster

You can't.
One thing to is to convert all generics to ArrayList and cast.

Ramy Mahrous 401 Postaholic Featured Poster

Comment datagridview1.dataBind(); or remove it.

Ramy Mahrous 401 Postaholic Featured Poster
Ramy Mahrous 401 Postaholic Featured Poster

It's my pleasure really adatapost when you correct for me, thanks a lot :)

kvprajapati commented: You are industrious. +3
Ramy Mahrous 401 Postaholic Featured Poster

Code tag please!!
Try that please

SqlConnection objSqlConnection = new SqlConnection();
string connectionStringSettings = "Data Source =.; Initial Catalog = LibrarySystemManagement;Integrated Security = SSPI";
private void btnSearch_Click(object sender, EventArgs e)
try
{
objSqlConnection.ConnectionString = connectionStringSettings;
objSqlConnection.Open();

if ((txtBookName.Text != "") || (txtCategory.Text != ""))
{

SqlCommand objSqlCommand = new SqlCommand("select * from LIBRARYBOOKDETAILS where Title = '"+txtTitle.Text+"'", objSqlConnection);

dataGridView1.DataSource = objSqlCommand.ExecuteReader();
//objSqlDataAdapter.Update(objDataTable);
dataGridView1.DataBind();
objSqlConnection.Close();
}
}
catch (Exception e1)
{
MessageBox.Show(e1.Message + e1.Source);
}
}
Ramy Mahrous 401 Postaholic Featured Poster

You're welcome.
LOOK don't ever expect to find business problems and the solution because this experience just in companies and software houses else you'll find tutorial to concepts, language features, etc etc
I gave you 2 distinct ways to learn (Video and FunctionX) you can back to learn from books and I personally don't recommend this way.

Ramy Mahrous 401 Postaholic Featured Poster

Just calm down!!
Just try when someone doesn't answer your question just like you imagine, FIRST thank him\her then ask more question or clarify what you need!!
Here you are http://www.functionx.com/

Ramy Mahrous 401 Postaholic Featured Poster
Ramy Mahrous 401 Postaholic Featured Poster

Sorry!! Where's your question?
Do you need a tutorial for C#?

Ramy Mahrous 401 Postaholic Featured Poster

Duplicated thread please delete it. http://www.daniweb.com/forums/thread199431.html

Ramy Mahrous 401 Postaholic Featured Poster

I don't have the code you can read about it, just googlize it. also for comparing strings you'll find a dozen of examples.

Ramy Mahrous 401 Postaholic Featured Poster

adatapost, please don't offend people, try to answer their questions even if they are novice.

Ramy Mahrous 401 Postaholic Featured Poster

Try to implement Insertion Sort in C# http://www.publicjoe.f9.co.uk/csharp/sort03.html use string instead of integer and you may use IComparer interface.

Ramy Mahrous 401 Postaholic Featured Poster

Very good adatapost, I forgot to open connection!

Ramy Mahrous 401 Postaholic Featured Poster

EncryptMyData (byte[] plainData, out byte[] encryptionKey)<-- what the mean of this???

It sends two arrays of byte datatype one is plain text (to be encrypted and the second is the key the text encrypted by)
You're welcome please mark this thread as solved.
Any question regards the code please reply on the blog there.