Click here to Skip to main content
16,011,680 members

Comments by Gaurav Manusmare (Top 7 by date)

Gaurav Manusmare 20-Mar-14 13:55pm View    
SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=SMS;Integrated Security=True");
con.Open();
SqlDataAdapter sda = new SqlDataAdapter("select first,last,barnch from student_info2 join marks1 on uid where marks1.ssc >'" + ssc.Text + "',marks1.hsc >'" + hsc.Text + "',marks1.aggregate >'" + be.Text + "'", con);
//cmd.ExecuteNonQuery();
//con.Close();
DataTable dt = new DataTable();
sda.Fill(dt);
dataGridView1.Rows.Clear();
foreach (DataRow row in dt.Rows)
{
int n = dataGridView1.Rows.Add();
dataGridView1.Rows[n].Cells[0].Value = row["first"].ToString();
dataGridView1.Rows[n].Cells[1].Value = row["last"].ToString();
dataGridView1.Rows[n].Cells[1].Value = row["branch"].ToString();

}

still not working
Gaurav Manusmare 20-Mar-14 11:53am View    
SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=SMS;Integrated Security=True");
con.Open();
SqlCommand cmd = new SqlCommand("select * from marks1(ssc,hsc,aggregate)values('"+ssc.Text+"','"+hsc.Text+"','"+be.Text+"')and from student_info2(branch)values('"+branch.Text+"') ",con);
cmd.ExecuteNonQuery();
con.Close();
Gaurav Manusmare 20-Mar-14 11:01am View    
just give me some basic idea
Gaurav Manusmare 21-Feb-14 12:31pm View    
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace listbox
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{

SqlConnection connection = new SqlConnection("Data Source=.;Initial Catalog=email_client;Integrated Security=True");
SqlCommand command = new SqlCommand("Select * FROM address_book ", connection);

try
{
connection.Open();
{
SqlDataReader drd = command.ExecuteReader();

while (drd.Read())
{
this.checkedListBox1.Items.Add(drd.GetString(0).ToString());

}
}

}
catch (Exception ex)
{

MessageBox.Show(ex.Message.ToString());

}

connection.Close();
}

private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{




}

private void checkedListBox1_SelectedIndexChanged(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=email_client;Integrated Security=True");
con.Open();
SqlCommand cmd = new SqlCommand("select *(name,id) from address_book where name ='" + checkedListBox1.Text + "'", con);
SqlDataReader reader;
reader = cmd.ExecuteReader();

}


}
}
Gaurav Manusmare 15-Feb-14 23:23pm View    
thank u sir ........but still m not clear with the provided solution ...........can u plz explain that how can i you this procedure in my coading ...... if possible then provide me accurate coading as i am beginner