Note that there are some explanatory texts on larger screens.

plurals
  1. PODatetimepicker and smalldatetime
    primarykey
    data
    text
    <p>I have this code in C#:</p> <pre><code>label3.Text = dateTimePicker1.Value.ToString(); DateTime vencim = dateTimePicker1.Value; DataTable llenar3 = minaf.cargrid3(vencim); BindingSource forwo = new BindingSource(); forwo.DataSource = llenar3; dataGridView1.AutoGenerateColumns = true; dataGridView1.DataSource = llenar3; dataGridView1.Refresh(); </code></pre> <p>cargrid3 is this :</p> <pre><code>DataTable rcargaP = new DataTable(); SqlConnection abre1 = Tconex.GetConnection(); SqlDataAdapter da3 = new SqlDataAdapter(); SqlCommand llena5 = new SqlCommand("vencedata", abre1); SqlParameter para1 = new SqlParameter("@venci", SqlDbType.SmallDateTime); para1.Value = vence; llena5.Parameters.Add(para1); llena5.CommandType = CommandType.StoredProcedure; da3.SelectCommand = llena5; da3.Fill(rcargaP); return rcargaP; </code></pre> <p>and the procedure is this : </p> <pre><code>alter proc vencedata (@venci datetime)as select conta,vencimento,pagamento,historico,original,formpagto,planoconta,clifor from financeiro where vencimento &gt;= @venci order by vencimento desc </code></pre> <p>the datetimepicker works, the proc works if I write in SQL Studio:</p> <pre><code>vencedata '01/31/2013' </code></pre> <p>the procedure vencedata only works in this format </p> <pre><code>vencedata '03/28/2013' (mm/dd/yyyy) </code></pre> <p>but the when i try </p> <pre><code>vencedata '28/03/2013'(dd/mm/yyyy) </code></pre> <p>i have try too this : </p> <pre><code>alter proc vencedata (@inicio smalldatetime/*,@final smalldatetime*/)as select idconta,vencimento,pagamento,historico,original,formpagto,planoconta,clifor from financeiro where vencimento &gt;= convert (varchar, @inicio,101) </code></pre> <p>a dont work.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload