hi
how to insert default year in database by uing a textbox in button click event.
here iam asp.ent with vb.net
database is sqlserver-2005.
pls give me code

Hello there

see the example below

  Dim dt As Date
    dt = Date.Today

  'SQL query will look like this at button click event
  insert into table1(col1 , col2) values('1',"'" &  dt.Year.ToString & "'")

Mark as solved if it helps you!!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.