hi guys i am trying to fill datagrid from database.I using the following code.Can anyone tell me what am i doing wrong.
public Form1()
{
InitializeComponent();
richTextBox1.Text = "Word: I \nDefinition:";
richTextBox3.Text = "Word: I \nDefinition:";
label2.Text = "Hindi";
dateTimePicker1.Visible = false;
SqlDataAdapter dtadp = new SqlDataAdapter();
DataTable dtbl = new DataTable();
dateTimePicker1.Visible = true;
SqlConnection cn = new SqlConnection(@"Server=208.124.179.197;Database=RTLUser;UID=sa;");
cn.Open();
DataSet data = new DataSet();
string myString = "";
myString = @"Select word from germanTbl";
SqlCommand cmd = new SqlCommand(myString, cn);
SqlDataReader rdr = cmd.ExecuteReader();
cn.Close();
dtadp.SelectCommand = cmd;
dtadp.Fill(data);
dataGridView2.DataSource = dtbl;
}