Quantcast
Channel: Web Forms
Viewing all articles
Browse latest Browse all 23244

Must declare the scalar variable "@datetime"

$
0
0

I am getting an error in a Try/Catch Textbox I have set up:

"Must declare the scalar variable "@datetime"."

Here is the code in question:

TextBox1.Text = System.DateTime.Now.ToString()

cmd.Parameters.AddWithValue("@datetime", TextBox1.Text)

There is an auto increment variable before it: idr int identity(1,1) not null.


Viewing all articles
Browse latest Browse all 23244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>