How to store dataset to a table in the database. Please be specific. Urgent

Discussion in 'General Computer Support' started by fullblown, Sep 20, 2006.

  1. fullblown

    fullblown

    Joined:
    Sep 20, 2006
    Messages:
    1
    Likes Received:
    0
    I have create the following datarow:

    _dtProjectQuestion.Columns.Add("ProjectQuestionNo");
    _dtProjectQuestion.Columns.Add("ProjectQuestionType");
    _dtProjectQuestion.Columns.Add("ProjectQuestionName");
    _dtProjectQuestion.Columns.Add("ProjectQuestionLastModifiedDate");
    _dtProjectQuestion.Columns.Add("ProjectQuestionDateFormat");
    _dtProjectQuestion.Columns.Add("ProjectQuestionShortLabel");
    _dtProjectQuestion.Columns.Add("ProjectQuestionLongLabel");
    _dtProjectQuestion.Columns.Add("ProjectQuestionMessage");
    _dtProjectQuestion.Columns.Add("ProjectQuestionMinAnswer");
    _dtProjectQuestion.Columns.Add("ProjectQuestionMaxAnswer");
    _dtProjectQuestion.Columns.Add("ProjectQuestionCodeWidth");
    _dtProjectQuestion.Columns.Add("ProjectQuestionHasOpenEnd");
    _dtProjectQuestion.Columns.Add("ProjectQuestionIsActive");
    _dtProjectQuestion.Columns.Add("ProjectQuestionIsCalculated");
    _dtProjectQuestion.Columns.Add("ProjectQuestionLBoundary");
    _dtProjectQuestion.Columns.Add("ProjectQuestionUBounday");
    _dtProjectQuestion.Columns.Add("ProjectQuestionMaxtrixNo");
    _dtProjectQuestion.Columns.Add("ProjectQuestionMatrixLength");

    I added rows to the datatable _dtProjectQuestion. Now I have multiple rows to insert into the database table below.
    _dtProjectQuestion.Rows.Add(_rowProjectQuestion);

    Then I accept changes and added the datatable to a dataset.
    _dtProjectQuestion.AcceptChanges();
    _dsProjectQuestion.Tables.Add(_dtProjectQuestion);

    Here is my database table that I want to map to.
    How can I go about doing this. If create stored procedure then I need explanation on how to do this.
    USE [RG_ProjectData]
    GO
    /****** Object: Table [dbo].[ProjectQuestion] Script Date: 09/20/2006 08:03:17 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[ProjectQuestion](
    [ProjectQuestionId] [int] IDENTITY(1,1) NOT NULL,
    [ProjectQuestionNo] [int] NULL,
    [ProjectQuestionType] [nchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    [ProjectQuestionName] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    [ProjectQuestionLastModifiedDate] [datetime] NULL,
    [ProjectQuestionDateFormat] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    [ProjectQuestionShortLabel] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    [ProjectQuestionLongLabel] [nvarchar](1000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    [ProjectQuestionMessage] [nvarchar](1000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    [ProjectQuestionMinAnswer] [tinyint] NULL,
    [ProjectQuestionMaxAnswer] [tinyint] NULL,
    [ProjectQuestionCodeWidth] [int] NULL,
    [ProjectQuestionHasOpenEnd] [bit] NULL,
    [ProjectQuestionLBoundary] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    [ProjectQuestionUBounday] [nvarchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
    [ProjectQuestionMaxtrixNo] [int] NULL,
    [ProjectQuestionMatrixLength] [int] NULL,
    [ProjectQuestionIsActive] [bit] NULL,
    [ProjectQuestionIsCalculated] [bit] NULL,
    CONSTRAINT [pk_ProjectQuestion] PRIMARY KEY CLUSTERED
    (
    [ProjectQuestionId] ASC
    )WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
    ) ON [PRIMARY]
     
    fullblown, Sep 20, 2006
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.