Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8677257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:24:43+00:00 2026-06-12T20:24:43+00:00

my objects WDst,WDet,SATst,SATet are DATETIME class objects which contains value of time from the

  • 0

my objects WDst,WDet,SATst,SATet are DATETIME class objects which contains value of time from the text boxes.

all the start time and end time parameters in my SP are of dATA type Time(7)
how can i use DateTime Object

i use following code to insert a schedule in my data base:

public void AddSchedule()
{
 connect = DAL.Con;
    SqlCommand com = new SqlCommand();
    com.Connection = connect;
    com.CommandType = CommandType.StoredProcedure;
    com.CommandText = "AddSchedule";
    SqlParameter parameters = new SqlParameter();
    com.Parameters.Add(new SqlParameter("SchedName",SqlDbType.VarChar)).Value=Schedulename;
    com.Parameters.Add(new SqlParameter("startTime",SqlDbType.Time)).Value=WDst;
    com.Parameters.Add(new SqlParameter("endTime",SqlDbType.Time)).Value=WDet;
    com.Parameters.Add(new SqlParameter("SatStartTime", SqlDbType.Time)).Value=SATst;
    com.Parameters.Add(new SqlParameter("SatEndTime", SqlDbType.Time)).Value=SATet;
    connect.Open();
    com.ExecuteNonQuery();
    connect.Close();
}

Error occurs at Com.ExecuteNonQuery … Nothing is wrong with my stored procedure.

How can i save Only Time from my Date Time Objects that haS saved time values as follows:

protected void SaveSched_Click(object sender, EventArgs e)
{
    Schedule obj = new Schedule();
    obj.Schedulename = SchedName.Text;
    obj.WDst = Convert.ToDateTime(StartTime.Text);
    obj.WDet = Convert.ToDateTime(EndTime.Text);
    obj.SATst = Convert.ToDateTime(SatSt.Text);
    obj.SATet = Convert.ToDateTime(SatEt.Text);
    obj.AddSchedule();
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T20:24:45+00:00Added an answer on June 12, 2026 at 8:24 pm

    Try

    com.Parameters.Add(
               new SqlParameter("startTime",SqlDbType.Time)).Value = 
                                   WDet.ToString("HH:mm:ss");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

MyModel.objects.filter(field__icontains=value) returns all the rows whose field contains value . How to do the
All objects in my program inherit from a Container class. The Container class has
Sending objects to ASP.NET from JSON works fine if you have a class built
Objects in my open-source toolkit are all based on the class AbstractObject. I want
All objects used as keys in NS(Mutable)Dictionaries must support the NSCopying protocol, and those
Preferences objects present a way to store arbitrary data into Rally which can be
I know that immutable objects always have the same state, the state in which
Objects of the following class can be serialized to XML as intended, as long
Objects with the same attributes and methods belongs to the same class? Can't I
If objects contains null or empty then how to validate or check the condition

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.