Click here to Skip to main content
15,868,016 members

Comments by shaikh-adil (Top 200 by date)

shaikh-adil 15-Jan-13 13:05pm View    
+5
shaikh-adil 15-Jan-13 12:51pm View    
sir it is bonding which me and sergey.. he helps me when i have some query. so i dont care what people thinks and flags me if they want. he likes helping me. and replies when i am in need.
shaikh-adil 15-Jan-13 12:45pm View    
sir your answer is correct (thank you really for helping me and newbies) can you further help me that can i count the total number of rows in that column? what i have to made changes?
shaikh-adil 15-Jan-13 11:36am View    
Deleted
SqlConnection con = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=E:\project\Database1.mdf;Integrated Security=True;User Instance=True");
con.Open();
string intero = "select sum(no_of_mobiles) from table2 where datepart(mm,given_schedule)=yourMonthSelected and datepart(yy,given_schedule)=yourYearSelected";
SqlCommand cmd = new SqlCommand(intero, con);
cmd.Parameters.AddWithValue("yourMonthSelected", comboBox1.Text);
cmd.Parameters.AddWithValue("yourYearSelected", comboBox2.Text);

SqlDataReader rdr;

rdr = cmd.ExecuteReader();

while (rdr.Read())
{
label2.Text = rdr.ToString();
}

rdr.Close();
con.Close();
sir it is erroring with "Invalid column name 'yourMonthSelected'.
Invalid column name 'yourYearSelected'." whats the problem here can you solve please if you
shaikh-adil 15-Jan-13 11:06am View    
sir can you one more time help me out www.codeproject.com/Answers/528150/sortingplusbyplusmonthplus-26plusaddingplustheplus