Page 1 of 1

Problem With "Date" data type

Posted: Fri 05 Jul 2013 14:45
by fulvion
Hi,
we have problems executing stored procedure which contains parameters with "date" data type.
The error says that "is not possible to cast SQL_Variant to DATE and CONVERT function must be used".

the problem is that we must, necessarily, use the prepare statement to retrieve parameters and, such parameters, are returned as "string" data type instead of a date one.

we're using sql connect for sql server pro V2.60.760 and SQL server express 2008.

here's the code we used to notice this behaviour:

Code: Select all

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Devart.Common;
using Devart.Data.SqlServer;
using System.Data;

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

        private void button1_Click(object sender, EventArgs e)
        {
            SqlConnection _Connection = new SqlConnection("Server=DBISTANCE;Database=Test;User Id=TestSQL;Password=test;");

            DbCommandBase myCommand = null;
            myCommand = new SqlCommand("sp_TestDate", (SqlConnection)_Connection);
            myCommand.CommandType = CommandType.StoredProcedure;
            myCommand.ParameterCheck = true;
            _Connection.Open();
            myCommand.Prepare();
            foreach (SqlParameter par in myCommand.Parameters)
            {
                SqlType t = par.SqlType;  //String datatype?!?
            }
        }
    }
}
"sp_Test" procedure is a simple stored procedure with one parameter of type "Date".
thanks in advance for your help
Fulvio


Edit: sql connect for sql server pro V2.60.769

Re: Problem With "Date" data type

Posted: Mon 08 Jul 2013 14:52
by Pinturiccio
We have reproduced the issue. We will investigate it and notify you about the results as soon as possible.

Re: Problem With "Date" data type

Posted: Tue 09 Jul 2013 08:53
by fulvion
Thanks for your support

Re: Problem With "Date" data type

Posted: Wed 10 Jul 2013 13:19
by Pinturiccio
We have fixed the bug with a stored procedure parameter with the Date type when describing a command. We will post here when the corresponding build of dotConnect for SQL Server is available for download.

Re: Problem With "Date" data type

Posted: Wed 10 Jul 2013 14:05
by fulvion
good news! we've some time left before deploying the new version our application.
do you think that it'll be just a matter of days? or months?

thanks
F

Re: Problem With "Date" data type

Posted: Wed 10 Jul 2013 14:45
by Pinturiccio
We are planning to release the next public build of dotConnect for SQL Server next week.

Re: Problem With "Date" data type

Posted: Fri 19 Jul 2013 08:07
by Pinturiccio
The new build of dotConnect for SQL Server 2.60.780 is available for download now!
It can be downloaded from http://www.devart.com/dotconnect/sqlser ... nload.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?t=27553