asp.net - How to Insert a Particular column in sql server -


I have the presence of the table student and the columns are

 < Code> st_id | Student name | Months | Year | Day1 to day30  

And, asp.net I am using when I click on the current button then the st_id , studentname in the database column The values ​​of , month , year should be included, and days should be systemdate . The date should be entered in the SQL column in the day column and the remaining empty value should be

  Assume that if I enter today today, 4 data will be entered in the current day like 4 < / Code> 

try this type

  DECLARE @st_id int = 1 declared @StudentName varchar (50) = 'Dinesh' declared @month varchar (50) = 'Announced announces @year integer = 2014 @SQL nvarchar (max) =' (st_id, StudentName, Month, Year, Day Addition '+ Cast (DatePart (day, GETDATE) ) As varchar (10)) + 'values ​​(' varchar (max)) as' cast (@st_id) + ',' '' @ @ @@@@ @ @ @ @ @ @ @ @ @ @ google_continentEmail by mutual agreement VARCHAR form @year (10) + ',' 'current' ')' print @sql  

< Strong> use process

  process sp_insertStudents @st_id integer, @StudentName varchar (50), @month varchar (50), @year integer declaration form as initially For @ sql newware (max) = 'Enter as Virchir (10) (stady id, student name, month, year, day' + Cost ('datapaptor' (day, day, greeting (+)) + 'values ​​(' + '(VARCHAR (@st_id as Max)) +', '' '@ @ @@@@@@ @ (VARCHAR (@month as Max)) + '' ',' + Cast (VARCHAR form @year (10)) + ',' 'Current' ') Print @SQL EXEC (@SQL) end   Output  

  (st_id, studentName, month, year, day4) Value (1, 'Dinesh,' 'Jan', 2014 , 'Current') enter  

Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -