hi
I am new to asp.net. I appreciate your assistance in clarifying the following:
Which Data type I should use
1. Ado type vs .net type vs sqlDbType vs sqlType
I did the following in visual studio
Imports System.Data
Imports System.Data.SqlClient
Imports System.Data.SqlDbType
Imports System.Data.SqlTypes
1. Dim x As Data.SqlDbType
2. Dim y As Data.SqlTypes.SqlDateTime
#1. stopped and did not show me intellisence of different datatype,
#2. it shows me all different type of datatype
I read somewhere that I have to use SqlDbType in a command parameter. Is it a must and if so, how can I get datetime datatime in the following parameter sample
myCmd.Parameters.Add(New SqlParameter("@mydate",SqlDbType.NChar,10))
as you see, I have not used datetime datatype, because I could not find its type, instead I used Nchar and it worked,but the problem is when I do not insert a value it automatically put 1900/1/1 by default.
any idea thanks
Al
I am new to asp.net. I appreciate your assistance in clarifying the following:
Which Data type I should use
1. Ado type vs .net type vs sqlDbType vs sqlType
I did the following in visual studio
Imports System.Data
Imports System.Data.SqlClient
Imports System.Data.SqlDbType
Imports System.Data.SqlTypes
1. Dim x As Data.SqlDbType
2. Dim y As Data.SqlTypes.SqlDateTime
#1. stopped and did not show me intellisence of different datatype,
#2. it shows me all different type of datatype
I read somewhere that I have to use SqlDbType in a command parameter. Is it a must and if so, how can I get datetime datatime in the following parameter sample
myCmd.Parameters.Add(New SqlParameter("@mydate",SqlDbType.NChar,10))
as you see, I have not used datetime datatype, because I could not find its type, instead I used Nchar and it worked,but the problem is when I do not insert a value it automatically put 1900/1/1 by default.
any idea thanks
Al