Visual Studio Calander

Discussion in 'ASP.NET / ASP.NET Core' started by whattoeatwh, Dec 9, 2006.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hello ,
    I have designed an application in visual studio .net, it enters info from a calander that is included with vs.net.

    the stored proceedure looks like this

    CREATE PROCEDURE dbo.Add_Client
    (
    @cliID int,
    @cliName varchar (50),
    @cliBizName varchar (50),
    @cliAddress varchar (50),
    @cliState varchar (50),
    @cliSuburb varchar (50),
    @cliCity varchar (50),
    @cliPostcode varchar (50),
    @cliEmail varchar (50),
    @cliPhone varchar (50),
    @cliFax varchar (50),
    @cliDLast datetime,
    @cliDNext datetime,
    @cliBizType varchar (50),
    @cliSalesStatus varchar (50),
    @cliComments varchar (1000)

    )
    AS

    INSERT INTO Client
    (

    cliID,
    cliName,
    cliBizName,
    cliAddress,
    cliState,
    cliSuburb,
    cliCity,
    cliPostcode,
    cliEmail,
    cliPhone,
    cliFax,
    cliDLast,
    cliDNext,
    cliBizType,
    cliSalesStatus,
    cliComments


    )
    VALUES
    (

    @cliID,
    @cliName,
    @cliBizName,
    @cliAddress,
    @cliState,
    @cliSuburb,
    @cliCity,
    @cliPostcode,
    @cliEmail,
    @cliPhone,
    @cliFax,
    @cliDLast,
    @cliDNext,
    @cliBizType,
    @cliSalesStatus,
    @cliComments

    )
    SELECT @@IDENTITY
    GO

    I have passed the date in a .cs file like this




    public string DLast


    {


    get {return dlast;}


    set {dlast = value;}


    }string dlast;


    public string DNext


    {


    get {return dnext;}


    set {dnext = value;}


    }string dnext;





    the code behind the button like this





    private void btnUpdate_Click(object sender, System.Web.UI.ImageClickEventArgs e)


    {





    int ownerID = int.Parse(Session["userID"].ToString());


    RestDB Client = new RestDB();


    Client AddClient = new Client();





    AddClient.CliID = (ownerID);


    AddClient.Name = txtName.Text;


    AddClient.BizName = txtBizName.Text;


    AddClient.Address = txtAddress.Text;


    AddClient.State = cboState.SelectedValue;


    AddClient.Suburb = txtSuburb.Text;


    AddClient.City = txtCity.Text;


    AddClient.Postcode = txtPostCode.Text;


    AddClient.Email = txtEmail.Text;


    AddClient.Phone = txtPhone.Text;


    AddClient.Fax = txtFax.Text;


    AddClient.DLast = calDateLast.SelectedDate.ToString("yyyy/dd/MM");


    AddClient.DNext = next.SelectedDate.ToString("yyyy/dd/MM");


    AddClient.BizType = cboBizType.SelectedValue;


    AddClient.SalesStatus = cboSalesStatus.SelectedItem.ToString();


    AddClient.Comments = txtComments.Text;





    Client.NewClient(AddClient.CliID,AddClient.Name,AddClient.BizName,AddClient.Address,


    AddClient.State,AddClient.Suburb,AddClient.City,AddClient.Postcode,AddClient.Email,


    AddClient.Phone,AddClient.Fax,AddClient.DLast,AddClient.DNext,AddClient.BizType,


    AddClient.SalesStatus,AddClient.Comments);


    }


    I have also tried


    AddClient.DNext = next.SelectedDate.ToString("MM/dd/yyyy");


    I have put a break piont and it does get the date but seems to not be able to pass it through the stored proceedure I get a message like this,


    String was not recognized as a valid DateTime





    Can anyone help?
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page