1

hello, Nemo
try this code...

[CODE] private void button1_Click(object sender, EventArgs e)
{

        if (textBox1.Text == "")
        {
            label5.Text = "Please Enter Your Login ID!";
            textBox1.Focus();
        }
        else if (textBox2.Text == "")
        {
            label5.Text = "Please Enter Your Password!";
            textBox2.Focus();

        }

        else
        {

            con = new SqlConnection("Data Source=.;Initial Catalog=INOXHOTEL;User ID=sa;Password=niitdelhi ");

            cmd = new SqlCommand();
            cmd.Connection = con;
            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "Select * from LoginUser where LoginID='" + textBox1.Text + "' and Password='" + textBox2.Text + "'";
            con.Open();
            result = cmd.ExecuteNonQuery();

            dr = cmd.ExecuteReader();

            while (dr.Read())
            {

                login = dr[0].ToString();
                password = dr[1].ToString();

            }

            dr.Close();
            con.Close();

            if (textBox1.Text == login)
            {
                if (textBox2.Text == password)
                {
                    userid = textBox1.Text;
                    userpwd = textBox2.Text;
                    // m1.Show();
                    MainForm m = new MainForm();
                    this.Hide();
                    m.Show();
                }

            }

            else
            {
                label5.Text = "Please Enter Correct Login ID And Password!";
            }

        }

}[/CODE]
May be help full...

2

use this code...
it is working....
[CODE]using System;
using System.Collections.Generic;
using System.Text;

namespace New_Matrix
{
class Program
{
static void Main(string[] args)
{
int[,] m1 ={ { 5, 4, 3 }, { 3, 2, 1 }, { 1, 1, 1 } };
int[,] m2 ={ { 5}, { 3}, { 1 } };
int[,] res=new int[3,1];

        for (int i = 0; i < res.GetLength(0); i++)
        {
            for (int j = 0; j < res.GetLength(1); j++)
            {
                for (int k = 0; k < m1.GetLength(1); k++)
                {
                    res[i, j] += m1[i, k] * m1[k, j];
                }
            }
        }

        for (int i = 0; i < res.GetLength(0); i++)
        {
            for (int j = 0; j < res.GetLength(1); j++)
            {
                Console.Write(res[i, j] + "\t");
            }
            Console.WriteLine();
        }
    }
}

}
[/CODE]

Votes + Comments
nice code
good solution
1

Thank you... for your help.
i try this code it it working also.
[CODE]using System;
using System.Collections.Generic;
using System.Text;

namespace temp
{
class Program
{

    static void Main(string[] args)
    {

        Int16 x = Int16.MaxValue;
        try
        {
            Int16 sum=checked((short)(x+1));
        }
            catch(OverflowException ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
    }
}

[/CODE]
But issue is why fist method not working. please tell in detail. pleaseeee..
how int16 converted in int32 automatically.

3

helloooo,
Actually, i want to know something. please read this code...

[CODE]using System;
using System.Collections.Generic;
using System.Text;

namespace temp
{
class Program
{

    static void Main(string[] args)
    {

Int16 i = Int16.MaxValue;

Console.WriteLine("Simple: " + (i ));
unchecked
{
Console.WriteLine("Unchecked: " + (i + 1));
}
checked
{
try
{
Console.WriteLine(i + 1);
}

catch (Exception ee)
{
Console.WriteLine("Error in Checked Block");
}
}
}
}
}
[/CODE]

this code [COLOR="Red"]not give any exception[/COLOR]. please any body tell me why? But if i use [COLOR="Green"]Int32[/COLOR] then it will generate exception.
Thank's in advance....

Votes + Comments
Good question
1

Simply we can say, command line argument is that argument which is passed to Main method.
Example is:

[code]
using System;
using System.Collections.Generic;
using System.Text;

namespace CommandLineArgument
{
class Program
{
static void Main(string[] args)
{
for (int i = 0; i < args.Length; i++)
{
Console.Write(args[i] + " ");
}
Console.ReadLine();
}
}
}
[/code]

Steps are:

  1. start visual studio and create new project.
  2. Go to Project menu and select the properties. Located in last(last option)
  3. select Debug tab in next screen.
  4. now you can see Command line arguments: option within Start option. Here you can pass your argument.

i already attached two image snapshot.

and second method is using command prompt.
Steps are:

  1. open command prompt of visual studio.
  2. go to the file location by using cd foldername command.
  3. compile your project by using csc filename.cs
  4. now type the filename, give one space and then type your argument and hit enter.

I hope this useful for you.
useful link- [URL="

Votes + Comments
thank's for your help
Attachments 1st_step.png 95.25 KB 2nd_step.png 94.58 KB
1

A jagged array is an array whose elements are arrays. The elements of a jagged array can be of different dimensions and sizes. A jagged array is sometimes called an "array of arrays".

[COLOR="Red"]NOTE:-[/COLOR] I'm using Single dimensional jagged array. Actually I am using single and multi dimensional arrays as a element of single dimensional jagged array. You can use "foreach" to print jagged arrays.

Paste PrintSingleDimentionalJaggedArray() and PrintMultiDimJaggedArray() methods in [COLOR="red"]main[/COLOR] method. You can download the example JaggedArray.zip file which is given below...

3

[B]1.[/B] Right click on your project name in solution explorer.
[B]2.[/B] Point the cursor on [COLOR="Green"]Add[/COLOR] then choose [COLOR="Green"]Existing Item...[/COLOR]
[B]3.[/B] Now go to the Location of your sound file and select that sound file.
[B]4.[/B] Now select your sound file in solution explorer then Right click on it choose Properties and change its [COLOR="Red"]Build Action[/COLOR] property([COLOR="Green"]Content[/COLOR] to [COLOR="Green"]Embedded Resource[/COLOR])
[B]5.[/B][COLOR="Green"]Build [/COLOR]the program or one time [COLOR="Green"]Debug[/COLOR] the program.
[B]6.[/B] Now if you want to play sound file when a particular Form is loaded then use the given code in [COLOR="Green"]Form_Load[/COLOR] event.
[B][COLOR="Green"]NOTE:-[/COLOR][/B]In this code [COLOR="Red"]Dreamer.wav [/COLOR]is name of sound file.
[B][COLOR="Green"]ASHISH[/COLOR][/B]

Attachments Step_1_2.JPG 35.36 KB