using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Configuration;
using System.Data.OleDb;
namespace rnd
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void label1_Click(object sender, EventArgs e)
{
}
private void button3_Click(object sender, EventArgs e)
{
// ClassLibrary1.Class1 ob = new ClassLibrary1.Class1();
//int s=ob.abhinav(Convert.ToInt16(textBox1.Text),Convert.ToInt16(textBox2.Text));
// MessageBox.Show("Sum is "+s.ToString(),"SUMMATION",MessageBoxButtons.OK,MessageBoxIcon.Information);
ClassLibrary2.Class1 rt = new ClassLibrary2.Class1();
long nulti =rt.multiplication(Convert.ToInt16(textBox1.Text), Convert.ToInt16(textBox2.Text));
MessageBox.Show("multiply is" + nulti.ToString(), "multiply", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
private void button1_Click(object sender, EventArgs e)
{
try
{
long sum = (Convert.ToInt64(textBox1.Text) + Convert.ToInt64(textBox2.Text));
MessageBox.Show(sum.ToString());
textBox1.Text = "";
textBox2.Text = "";
}
catch (Exception a)
{
MessageBox.Show("please inter only integer in both textbox");
textBox1.Text = "";
textBox2.Text = "";
}
}
private void button2_Click(object sender, EventArgs e)
{
try
{
long mul = (Convert.ToInt64(textBox1.Text) * Convert.ToInt64(textBox2.Text));
MessageBox.Show(mul.ToString());
textBox1.Text = "";
textBox2.Text = "";
}
catch (Exception b)
{
MessageBox.Show("only integer value in both textbox");
textBox1.Text = "";
textBox2.Text = "";
}
}
bool validation()
{
if (textBox1.Text == "")
{
MessageBox.Show("plz fill textbox");
return false;
}
return true;
}
private void Form1_Load(object sender, EventArgs e)
{
//MessageBox.Show("as");
DateTime mydate = DateTime.Now;
textBox3.Text = mydate.ToString();
//MessageBox.Show(mydate.ToString());
//bool b = validation();
//if(b==true)
{
OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Documents and Settings\\Rajesh\\My Documents\\insert1.mdb");
OleDbCommand cmd = new OleDbCommand("select uname from insert1", con);
OleDbCommand cmd1 = new OleDbCommand("select uid from insert1", con);
OleDbDataAdapter da = new OleDbDataAdapter();
OleDbDataAdapter da1 = new OleDbDataAdapter();
DataSet ds = new DataSet();
da.SelectCommand = cmd;
da1.SelectCommand = cmd1;
da.Fill(ds,"abhinav");
da1.Fill(ds, "ashish");
for (int i = 0; i < ds.Tables["abhinav"].Rows.Count; i++)
{
chkbx_1.Items.Add(ds.Tables["abhinav"].Rows[i][0].ToString());
}
for (int i = 0; i < ds.Tables["ashish"].Rows.Count; i++)
{
chkbx_2.Items.Add(ds.Tables["ashish"].Rows[i][0].ToString());
}
}}
private void textBox4_KeyPress(object sender, KeyPressEventArgs e)
{
if (Convert.ToInt16(e.KeyChar) < 48 || Convert.ToInt16(e.KeyChar) > 57)
{
if (Convert.ToInt16(e.KeyChar) == 8)
{
}
else
{
e.Handled = true;
}
}
}
private void textBox5_KeyPress(object sender, KeyPressEventArgs e)
{
if ((char.IsLetter(e.KeyChar)) != true)
{
if (Convert.ToInt16(e.KeyChar) == 8)
{
}
else
{
e.Handled = true;
}
}
}
private void button4_Click(object sender, EventArgs e)
{
ClassLibrary1.Class1 ob = new ClassLibrary1.Class1();
int s=ob.abhinav(Convert.ToInt16(textBox1.Text),Convert.ToInt16(textBox2.Text));
MessageBox.Show("Sum is "+s.ToString(),"SUMMATION",MessageBoxButtons.OK,MessageBoxIcon.Information);
}
private void textBox6_KeyPress(object sender, KeyPressEventArgs e)
{
if ((char.IsLetter(e.KeyChar)) != true)
{
if (Convert.ToInt16(e.KeyChar) == 8)
{
}
else
{
e.Handled = true;
}
}
}
private void chkbx_1_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void textBox6_TextChanged(object sender, EventArgs e)
{
}
}
}
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||