Problem With "Date" data type

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Microsoft SQL Server
Post Reply
fulvion
Posts: 18
Joined: Fri 06 Oct 2006 09:47

Problem With "Date" data type

Post by fulvion » Fri 05 Jul 2013 14:45

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
Last edited by fulvion on Tue 09 Jul 2013 11:36, edited 1 time in total.

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Problem With "Date" data type

Post by Pinturiccio » Mon 08 Jul 2013 14:52

We have reproduced the issue. We will investigate it and notify you about the results as soon as possible.

fulvion
Posts: 18
Joined: Fri 06 Oct 2006 09:47

Re: Problem With "Date" data type

Post by fulvion » Tue 09 Jul 2013 08:53

Thanks for your support

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Problem With "Date" data type

Post by Pinturiccio » Wed 10 Jul 2013 13:19

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.

fulvion
Posts: 18
Joined: Fri 06 Oct 2006 09:47

Re: Problem With "Date" data type

Post by fulvion » Wed 10 Jul 2013 14:05

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

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Problem With "Date" data type

Post by Pinturiccio » Wed 10 Jul 2013 14:45

We are planning to release the next public build of dotConnect for SQL Server next week.

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Problem With "Date" data type

Post by Pinturiccio » Fri 19 Jul 2013 08:07

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

Post Reply