Looks good.

Simpler the better.

commented: Thanks +1

When you run an if statement if you give it a boolean value say true it will execute faster then a condition.

i.e

If (true)
then Work

boolean is a 1 or 0 bit operator 1 is true and 0 is false.

no when you do something like this

if ("Hello".Equals(TextBox1.Text))
then Work

it may seem instant but the machine had to make more of an effort.to generate the value.

What does this have to do with your question you might ask? Everything.

You see Select in SQL is basically an if statement.

Example

SELECT * from Products Where id = 123 and Name ='John'

would translate to

if (id = 123 and Name ='John')
then Showrecords().

When you search by index the query has less to do then it would if it didn't have an index.

Example.

There is a Record in your database
[CODE]ID | Name | Age | Department |
11 | John | 28 | IT |[/CODE]

Now if you search for the Record by index.

[CODE=SQL]SELECT * FROM Employees Where ID = 11[/CODE]

or

[CODE=SQL]SELECT * FROM Employees WHERE Name ='John'[/CODE]

Remember machine stores everything in binary.

Which one do you think will execute faster.

When you do these operation on a small scale it is a negligible performance gain. But When you want to get a single value from thousands of records that is where you will see the difference in performance.

Hope my explanation was satisfactory.

commented: clear +1

Zinderin I sincerely I apologize if you take my response as aggressive.

Kav do you know why you are doing this?
[CODE]for (int person = 0; person < QuizGrades.Length; person++)

    {
        total = 0;

        //prints out student name
        for (int quizCount = 0; quizCount < amount; quizCount++)

        {
            //Write statement here to print out each quiz grade
            total = total + QuizGrades[person, quizCount];
        }

        //QuizAverage[person] = total / amount;
        QuizAverage[person] = total / QUIZCOUNT;

        //Write statement here to print out the student average
        Console.WriteLine("{0,5}{1,10}{2,15}{3,20}{4,20}", "Name", "Quiz 1", "Quiz 2", "Quiz 3", "Average");
        Console.ReadLine();
    }[/CODE]

It is a double for loop, one is to loop the Height the other the Length of the array.

Think like this.

this is your array
[CODE=Array] 87 | 68 | 94
100 | 83 | 78
85 | 91 | 76
65 | 81 | 66
65 | 71 | 56 [/CODE]

and you want the x,y coordinates to locate the different values and since array start with 0 to get 0,0 would mean 87 and 4,2 would be 56.

so when you loop the array you want to loop for the x and y.

do you see the problem?

Hint what is QuizGrades.Length equal to and what is amount equal to?
Index refers to your position in the array. Index out of Range Exception should be clear to you.

Let me know if you don't understand.

commented: well worded :) Always good to encourage people to find their own errors +1

Try something like this.

[CODE]frmReasonDeny frmRD = new frmReasonDeny()
if (frmRD.ShowDialog() == DialogResult.OK)
{
// Ok statement
MessageBox.Show("Hurray");
}
else
{
//Cancel/quit/anything other then clicking ok
MessageBox.Show(":(")
}
[/CODE]

In frmReasonDeny you want to do
[CODE]
this.DialogResult= DialogResult.OK;

//or

this.DialogResult= DialogResult.Cancel;[/CODE]

In the respective buttons.

Enjoy.

kavisg1 please use code tagging.

Select your code and press the CODE Button.

Ok Lets break down what you did.

baby steps.

decimal[,] Quizzes = { { 87, 68, 94 }, { 100, 83, 78 }, { 85, 91, 76 }, { 65, 81, 66 }, { 65, 71, 56 } };
Quizzes[4, 2];

Can you please explain what you did here. I mean do you understand what you did?

Please look at link Ryshad Provided.

decimal[,] Avergae = {{}, {}, {}, {}, {}};

Apart from the spelling mistake can you tell me what type of array this is from the link.

string[] Name = new string {{name}, {name}, {name}, {name}, {name}};

I understand this is to answer the extra credit question but Please leave that till you done with your actual assignment.

Please get back to me with your answers so I/we may help you further. You have more errors but Lets get the arrays corrected first.

:)

commented: with you on all counts :p +1

Where is you insert command?

I only see the string.

You need to move the ExecuteNonQuery() in to

[CODE]for(int i=0; i<Class.MyArray.Count; i++)
{
string InsertTable = "insert into table_name values('" + Class.MyArray[i].ProductA + "', '" + Class.MyArray[i].ProductB + "' )" ;
}[/CODE]

Cause if you run Execute once on the string InsertTable it will only do the last thing where i = Class.MyArray.Count-1

You see what I am saying?

it runs through this code making InsertTable = to the i^th Product A and B.

What you could/should do is.

[CODE]
MyConnection.Open();
for(int i=0; i<Class.MyArray.Count; i++)
{
new SqlCommand("insert into table_name values('" + Class.MyArray[i].ProductA + "', '" + Class.MyArray[i].ProductB + "' )", MyConnection).ExecuteNonQuery();
}
MyConnection.Close();[/CODE]

or

[CODE]
MyConnection.Open();
for(int i=0; i<Class.MyArray.Count; i++)
{
string InsertTable = "insert into table_name values('" + Class.MyArray[i].ProductA + "', '" + Class.MyArray[i].ProductB + "' )" ;
SqlCommand cmd = new SqlCommand();
cmd.Connection = MyConnection;
cmd.CommandText= InsertTable;
cmd.ExecuteNonQuery();
}
MyConnection.Close();[/CODE]

Enjoy.

Try using Switch Case
[CODE]switch(n) //basically like saying if n = case
{
case 1: //so if n = 1 then
cost += 25;
break;
case 2: // if n = 2 then
cost += 25;
goto case 1; // do n=2 then n=1 you need a break to end the case or it will keep going on see in case 1 there is a break
case 3: // is n = 3 then
cost += 50;
goto case 1;
default: // else
Console.WriteLine("Invalid selection. Please select 1, 2, or 3.");
break; // stop or ENDIF
}
[/CODE]

or (condition)? then:else;

[CODE]( x < 1 )? j = 0 : j = 1;[/CODE]

I am not sure what you are trying to do so this is as much as I can help you.

[QUOTE]And on July 21st, 2010, Skynet became self-aware. [/QUOTE]

Not yet, that is when AI is powerful enough.

This by itself is good IMO, I mean what harm can this technology do?

Maybe oppress the weak but then there are other things that give a similar result.

Anyway interesting read.

commented: True indeed, my friend. Thanks for your post :) +0

[CODE]studentsBindingSource.filter = "[First Name] like '" + txtFirstName.text + "%' AND [Last Name] Like '" + txtLastName.Test + "'%";[/CODE]

I assume that you seperated the First Name column and the Last Names column.

If not then you would need to play with Substring.

If you show some more examples I can help you.

Show me some effort.

Where is your code, what have you done so far.

Show me some pseudo code.

[QUOTE]Object reference not set to an instance of an object.[/QUOTE]

That usually refers to No Data being retrieved from The DB.

There are no such entries in the DB.

Since you know your code best, you should look to all the places where you are trying to Retrieve data, or think where this may be.

So in your case [QUOTE][CODE]SqlDataAdapter loadMsgAdapt = new SqlDataAdapter(@"SELECT mID FROM blMessages WHERE isDeleted = 'False'", loadMsgConn);[/CODE][/QUOTE] has to be the culprit.

Try adding a Try{} Catch{}

On second thought:

Code looks fine, I think this may be a timeout issue.

commented: Bump for reading all that code! :) +1

use SQL String commands in

using System.Data.SqlClient;

Then do something like

[CODE]YourConn.Open();
SQLDataReader Sdr = new SQLCommand("SELECT * FROM table WHERE id=001",YourConn).ExecuteReader();
if(Sdr.Read())
{
array[0] = sdr.GetInt32(0);
array[1] = sdr.GetString(1);
array[2] = //etc....

}
YourConn.Close();[/CODE]

@srky, Please mention what your database.

And please read about [URL="

try
[CODE]int.Parse(Data.Value.toString()); //for int
double.Parse(Data.Value.toString()); //for double
decimal.Parse(Data.Value.toString()); // for decimal
DateTime.ParseExact(Data.Value.ToString(), "yyyyMMdd", new System.Globalization.CultureInfo("en-US")); //for DateTime
Data.Value.toString(); /for String[/CODE]

Welcome to the Forums, can you smell your computer for melting resistors?

Ok first things first,

Remove all the components in the PC, Mouse, Keyboard, camera, Scanner, Printer, Graphics Card, Ram, Modem, Hardrive, CD-Rom, w/e TAKE IT OUT.

Leave only the Processor and motherboard, with the power cables ofc.

Boot you want to hear 3 or 4 evenly spaced beeps.

This means your Mobo and processor are fine.

Now you want to add RAM and boot you want to hear 1 Single beep to tell you that your ram is fine.

From here on you keep adding your components one by one and booting. When you don't hear the Beep you found the culprit.

I bet on the VGA but keep your fingers crossed, maybe it just a case of a bad fitting of the CPU.

Can you see if the Heatsink is secure? maybe it was a thermal event.

Let me know how it goes

Peace, Enjoy.

Please mark as solved if solved.

[QUOTE]matter[/QUOTE]
That is incorrect usage, usually I don't care about syntax but the the fact that you Thread title resembles string theory, and then you use the word matter.

Anyway, the data can be accessed by the child by using the following

[CODE]Form1 form1 = new Form1();
form1.label1.Text;[/CODE]

Make sure Label1 has Public Modifier.

Enjoy.
Mark as solved if solved.

commented: insert witty positive rating comment here +1

Wow, interesting. :)

Read up on nested loops.

You need a loop within a loop and you should have a 2 Dimensional Array.

Show me what you come up with or your logic, and I will help you.

Just don't ask straight up for the answer.

Ask as many questions as you want. Even if they are silly. It's the only way to learn.

Try and Write the pseudo code or make a flowchart.

you can use Datetime.ParseExact

Show me your work to get more.

commented: Nice suggestion. +6

You don't need to do Execute reader just use scaler.
[CODE] file = (byte[])cmd.ExecuteScaler();[/CODE]
As for Null there are two ways I handle it.

1st Method
Try
Catch

2nd Method

[CODE]"SELECT CASE WHEN Image IS NULL THEN DefaultImage ELSE Image END WHERE CarID = @CarID"[/CODE]

You can define DefaultImage as (byte[])new Image(URL)

Like

[CODE=SQL]"SELECT CASE WHEN Image IS NULL THEN '" + (byte[])new Image(URL) + "' ELSE Image END WHERE CarID = @CarID"[/CODE]

I haven't tried it for Images but it should work.

commented: amazing responce +2

with your fingers

-sorry couldn't help it

From what I understand you are unplugging and plugging the power cables.

What you need to do is take off all components. ie. PCI, ISA, USB, Mouse, Keyboard, VGA, Aux Fans (Non-essential Case Fans) etc. Leave only the Processor and the RAM, You want to hear one single Post beep.

If you don't hear the beep then Remove the RAM, Boot now you want to hear couple of beeps.

If you still don't hear any beeps then your motherboard or Processor is bad.

Not sure what you mean.

Are you saying you enter a value and then choose from a combobox the conversion type. So when you click the button the conversion occurs?

If this the case all you need to do is have an if statement to check which item in the combobox is selected

[CODE]comboBox1.SelectedIndex == 0[/CODE]
0 being the first item from the top, 1 being the second from the the top and so on.

I don't see the need for an array if you are only giving it one input.

duuguu welcome to the forums, please take some time and introduce your self in [url]http://www.daniweb.com/forums/forum165.html[/url]

Please familiarise yourself with rules. Don't hijack threads.

P.S. use code tagging.

commented: Words. +9

ok hmm, show me your logic or pseudo code.

so you want the code to populate the ListBox only right?

[CODE]listBox1.Items.Add("Whatever");[/CODE]

if you want more help please post what you done so far.

commented: Always helpful! +9

Please use code tagging

you didn't hook da with the conn.

yes AAC is supported by Iphone

[url]http://www.iskysoft.com/free-mac-video-downloader.html[/url]

[url]http://homepage.mac.com/major4/[/url]

Or for lossless MP3
[url]http://www.fraction.jp/log/archives/2008/01/18/FLVMP3Extractor[/url]

The quality degradation is minimal. It depends on how good the source is. If the source sucks no matter what you do, you can't get better than the source file.

MP3 is a compression standard, if you want high lossless quality you shouldn't be looking at youtube.

Please mark as solved if solved.

commented: Options! +7