Insertion Scheduled Job In SQL

Jun 19, 2005

Hi guys,i want to make a scheduled job that inserts 10 user defined row each minute continously in enterprise manager

View 1 Replies


ADVERTISEMENT

Insertion

Apr 28, 2008

Please someone help to get out this situation

How to perform bulk insertion in a table for different records

View 4 Replies View Related

Sql Insertion

Jun 10, 2008

How to bold a value while inserting into the table in SQL 2005?

View 1 Replies View Related

About Insertion

Apr 3, 2006

How to get information , if there is no insertion of a row in a table within particular span of time.

View 2 Replies View Related

Insertion Of Data

Mar 23, 2007

I am using vs2005 and sqlserver2000
My problem is i have 5 checkboxes and some textboxes.In this user selects the checkbox and textboxes dynamically .In this user selects one or two or three or when user selects header checkbox then all checkboxes are selected.And in my database i mentioned a single column for group of checkboes.So how should i insert the data into database

dim con as new sqlconnection("userid=sa;pwd=; initial catalog=test")
dim cmd as sql command

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
cmd.CommandText = "insert into check values(" what should i write here ....'" & text.text &"','" @ text2.text "'... ")
con.open()
cmd.executenonquery()
con.close()

End Sub

View 2 Replies View Related

Bulk Insertion

Nov 26, 2007

Hi,
I am working on an application that is to read a large number of XML files, take out specific values from each file, and store these in a SQL server so that reports can be generated from these values. There are some 15-20,000 files for each month of the year. I am OK with parsing the files and getting the fields that I need but I don't want to insert one record at a time as I parse the files. I was told that I can create a .exe file that parses the xml files and stores the required values in a csv file and use these csv files to initiate a bulk insert, using Business Intelligence Studio. I have not been able to find any info or article on how to do this. Any help on how I can accomplish this, or alternate solutions is greatly appreciated.

View 2 Replies View Related

Random Insertion

Jun 10, 2008

Hi Experts ,
I want to insert datas randomly to all columns of a table.The columns have different datatypes like int,varchar,datetime. What to do??? It is urgent so please help.


TIA

RKNAIR

View 2 Replies View Related

Random Insertion

Jun 10, 2008

Hi Experts ,
I want to insert datas randomly to all columns of a table.The columns have different datatypes like int,varchar,datetime. How to create a procedure for the same??? please help.


TIA

RKNAIR

View 1 Replies View Related

Getting Error While Insertion

Jun 18, 2008

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go


ALTER PROCEDURE [dbo].[usp_World_Ins_data]
-- Add the parameters for the stored procedure here
@UserName nvarchar(50),
@Password nvarchar(15),
@Email nvarchar(100),
@IsChecked bit,
@ReceiveNews bit

AS


BEGIN

SET NOCOUNT ON;

IF EXISTS(SELECT UserName FROM World_Registration WHERE UserName=@UserName)
RAISERROR('Username exists',16,1)
ELSE IF EXISTS(SELECT Email FROM World_Registration WHERE Email=@Email)
RAISERROR('Email exists',16,1)
ELSE
INSERT INTO World_Registration(UserName,Password,Email,IsChecked,ReceiveNews)
VALUES(@UserName,@Password,@Email,@IsChecked,@ReceiveNews)

END


if executed once it works properly like
[usp_World_Ins_data] 'aa','aa','ravinderpal@netbiz.in','1','1'

while if i m trying to execute stored procedure like this three times
i mean more than one time
[usp_World_Ins_data] 'aa','aa','ravinderpal@netbiz.in','1','1'
[usp_World_Ins_data] 'aa','aa','ravinderpal@netbiz.in','1','1'
[usp_World_Ins_data] 'aa','aa','ravinderpal@netbiz.in','1','1'

it gives error:
Msg 170, Level 15, State 1, Line 2
Line 2: Incorrect syntax near 'usp_World_Ins_data'.

pls help me

View 3 Replies View Related

Multiple Row Insertion

Mar 1, 2006

i am new to sql server
i want to insert five rows continously in sql server database.
my problem is like this .
i am inserting user datails. i want to get the userid which is an identity column.with the userid i want to insert userid and roleid in another table.Roleid values 1 to 5. ie constant.
an sql procedure is required.

View 10 Replies View Related

Record Insertion

Jul 20, 2005

Hi everyone,I tried to upload my database to my web host. Nevertheless as they donot give me enough permission to perform some DTS thus I have togenerate script to do it myself. The problem is MSSQL scriptgeneration operation can only generate the definitions of the objects,no data insertion sql is created.So is there any method to create insertion script for all the tablesin my database (they have automated increment key as well)Hope for your response!Thank you

View 2 Replies View Related

Insertion Problem

Oct 4, 2007

I have a table called ACCOUNTS which has 60,000 rows already in it. It has a columns called PolicyNo and PremiumBasisCode. PolicyNo has data inside it whereas Premiumbasiscode is NULL.

Now I have to insert the data inside the PremiumBasisCode Column from Table1 into ACCOUNTS table by joining them on Policy No (Inner Join).

One thing to remember, there are already 60,000 rows for which this insert needs to take place. What will be the best approach.

Chintan

View 4 Replies View Related

Formview Insertion And PostBackUrl

Sep 13, 2006

I am working in ASP.Net2.0 and Sql server 2005.Using asp button(FormView) I am trying to insert the data from the form into the database and at the same time want to move on to another page indicating the succes of insertion.My code: <asp:Button ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert"Text="Submit" PostBackUrl="~/ClinicDownload.aspx"></asp:Button> It is moving on to another page, but no insertion is taking place. If I don't give the PostBackUrl then I can insert. I want to do both in one click....Hope someone can help me. Regardspreeshma 

View 1 Replies View Related

SQL Insertion - Primary Key Retrieval

Apr 12, 2007

Hi there,
Is there a way to retrieve the set of primary keys from an inserted record, especially when the primary keys are generated upon insertion (ex. identity, uniqueid)?  Basically I need to get the ID of the record I just inserted so that I can use it as a reference to that record in other places.
I'm using MS SQL and raw SQL commands (ie. no database interfacing objects).  I'm hoping I can tag some sort of SELECT statement on the end of the INSERT command that will give me the results that I need.
Thanks!

View 3 Replies View Related

Date Insertion Problem

Aug 27, 2007

I am using BLL for inserting my data. I have some date filed and I have declare that field in BLL as date only. But still it is giving me error string in wrong format. My database is in SQL Server2005

View 6 Replies View Related

Insertion Od Data In The Table

Jun 19, 2008

Hi Friends,I have 3 labels Steet,City,Pincode and 3 textboxes related to the labels and one button as nae 'Address'I gave the data for Street:abc,City:xyz,Pincode:123 and have to insert into the table.I created one table in the database with table name Adreess and column address varchar(100)but after giving the values in the textboxes and clicked on the button its throwing the exception i.e System.Data.SqlClient.SqlException: The name "abcxyz123" is not permitted in
this context. Valid expressions are constants, constant expressions, and (in
some contexts) variables. Column names are not permitted.I wrote the code like following protected void Button1_Click(object sender, EventArgs e)    {        string street = txtStreetNo.Text;        string city = txtCity.Text;        string pincode = txtPincode.Text;        string com = street + city+pincode;        conn.Open();        SqlDataAdapter daInsert = new SqlDataAdapter("insert into Address values(" + com.ToString() + ")", conn);        daInsert.SelectCommand.ExecuteNonQuery();--->here its giving the exception        conn.Close();        Response.Write("the values are inserted");            }Please any one tell me am I did the code write or not if its not please give any suggetionsthanksGeeta  

View 3 Replies View Related

Preparing A String For SQL Insertion...

Nov 17, 2003

Hey,

I would like to prepare a string variable for SQL insertion. Like, replacing all the single quotes with the HTML code equivilent and such. Has anyone written alything like this? Is there a tutorial on the web for it? A control maybe?

Mike

View 2 Replies View Related

Japanese Insertion In Mssql

Nov 7, 2006

Hi,

I'm having a small problem inserting japanese text into a ms sql database.
All the fields are of type nvarchar and in my insert statement I use N'the value of the string' to make sure it insert unicode text.

Without the N I get only '??????' in my cells and with the N I see only empty squares.

Anyone have any solution how I can insert japanese text into mssql ?

thanks in advance

Jan

View 4 Replies View Related

Filtering Insertion By Two Fields

Feb 23, 2004

Hi,

I need to insert some registers in a table. These registers have three fileds: field1, field2 and field3. I don't want to insert a register if in the table already exists a row with the field2 and field3 combination of that register. And I don't want to declare these fields as key fields. How can I filter a "destination" table by two fields?
I'll appreciate your answer

Thanks


F.

View 4 Replies View Related

Insertion Into Partitioned Table

Apr 8, 2008

hello
i want to ask if the insertion of a record into a partion is slower than insertion it into a non partitioned table or not?
cuz sql has to decide to wich partion the record has to insert according to the partitioning key and is this decesion process is making insertion slower ?

View 2 Replies View Related

XML Data Insertion In Table

Sep 9, 2013

I want XML data to be inserted int SQL table but could not figure out. #Currency is my table with assocaite columns and @XMLCurrency is a variable which holds XML string. How can I insert this XML data to my table.

Create table #Currency (CurrencyId int ,ISOCode nvarchar(10),ISONumbricCOde int,ISOName nvarchar(50), IsEnabledForMPV int default 0)
Declare @XMLCurrency nvarchar(max)
Set @XMLCurrency='<R><T><A>0</A><B>USD</B><C>840</C><D>US Dollar</D></T></R>'

Value 840 should insert into column ISONumbricCOde .
value USD should be insert into ISOCode column.
value 0 should insert into column CurrencyId.
values US Dollar should insert into column ISOName .

View 2 Replies View Related

Sql Scripts For Insertion Of Records

Jan 24, 2006

i am executing this scripts in sql server2000

SELECT
'INSERT into temp values(data1, data2, data3)' +
'SELECT ' +
CONVERT(VARCHAR(20), temp2.data1) + ', ' + CONVERT(VARCHAR(20), temp2.data2) + ', ' + '''' + CONVERT(VARCHAR(20), temp2.data3) + ''''
FROM temp, temp2
order by temp2.data1


now my table temp and temp2 both has folowing fields and data type

data1 int
data2 int
data3 varchar(20)

befor execution i have 0 records in temp and 10 records in temp2.
this scripts supposed to add all 10 records from temp2 to temp but it does nothing. evevn it is not giving error too.

View 2 Replies View Related

Huge Data Insertion

Jun 12, 2006

Hi,

i have 4 tables, each consist of app. 10000000 rows.They have same columns (fTime[datetime] and bid[money]).What i wanna do is to collect all of datas into one of the tables, in ascending order by fTime.

PS i wanna do it as fast as possible as well

View 1 Replies View Related

Creating Procedure For Other Insertion

Nov 20, 2007

Hi everyone,

i am self-learner for sql server 2005.

can anybody help me,

currently, i have two tables..called
employee
(eg. empid varchar(10),languageid(10),quaid(10))

unprocesstable
(eg.unid uniqueidentifier, unpname varchar(50),unptablename varchar(50),empid (10) )

how to create another store procedure for other insertion?

eg.. whatever other language is inserted into employee by user which is not in the "language" table ,

it will inserted into (table "unprocesstable") under (column "unpname")

thank you so much!



Rg

View 5 Replies View Related

Change Of Value At The Time Of Insertion

Mar 16, 2006

Hai,Here is a query that i am creating a tablecreate table test10 (item varchar(10),state bit)now at the time of insertion i will enter like thisinsert into test10 values ('book' ,1)but at the time of display in the table i wantitem statebook truefrom above i want to ask that when i am going to insert 1 i want toget true and 0 as false.I never enter true or false in the insertcommand. please help me in coding.thankyou,lucky.Reply

View 3 Replies View Related

Data Insertion Too Too Slow...

Nov 27, 2007

Hi,Env is ms sql server 2000.ddl:create table srchPool(tid int primary key, taid int, s tynyint, uidtynyint);-- and sql server automatically creates a clustered index for the pkdml:insert into srchPool(taid,s,uid)select article_id, 99, 1484from targetTBLwhere article_content LIKE '% presentation %';insert into srchPool(taid,s,uid)select article_id, 55, 1484from targetTBLwhere article_content LIKE '% demonstration %';-- a few more similar queries ...The above insertion query TOOK about 2000ms to execute, too too slow,would be much faster if I insert the data sets into a temp tbl likeselect article_id, 99, 1484 into #srchPool(taid,s,uid)from targetTBLwhere article_content LIKE '% presentation %';-- once its use is finished and drop it?Many thanks.

View 7 Replies View Related

Opinions About Insertion Technique

Jul 20, 2005

Looking for some insight from the professionals about how they handlerow inserts. Specifically single row inserts through a storedprocedure versus bulk inserts.One argument are people who say all inserts (and updates and deletionsI guess) should go through stored procedures. The reasoning is thatthe developers that code the client side have no reason to understandHOW the data is stored, just that it is. Another problem is an insertthat deals with multiple tables. It would be very easy for thedeveloper to forget a step. That last point also applies to businesslogic. In my case, adding a security to our SecurityMaster can touch 1to 4 tables depending on the type of security. Also, certain fieldsare required while others are set to null for depending on the type.Because a stored procedure cannot be passed datasets but only scalarvalues, when you need to deal with multiple (i.e. bulk) rows you arestuck using cursors. This post is NOT about the pros and cons ofcursors. There are plenty of those on the boards (some of themprobably started by me and showing my understanding (or morecorrectly, lack of) of the way to do things). Stored procedures alsogive you the ability to abort and/or log inserts that cannot happenbecause of contraints and/or business rule failures.Another approach is to write code (not accessible from outside thedatabase) that handles bulk inserts. You would need to write in rulesto "extract" or "exclude" rows that do not match constraints orbusiness rules otherwise ALL the inserts would fail because of one badrow. I guess you could put the "potential" rows into a temp table.Apply your rules to the temp table and delete / move rows that wouldfail. Any rows left can that be bulk inserted. (You could also use therows that were moved to another temp table for logging why theyfailed.)So that leaves use with two possible ways to get data into the system.A single row based approach for client apps and a bulk based forinternal use. But that leaves use with another problem. You now havebusiness logic in TWO separate areas. You have to remember to modifycode or fix bugs in multiple locations.For those that are still reading my post, my question is...How do you handle this? What is the approach you take?

View 4 Replies View Related

DTS Package Insertion Error

Mar 2, 2007



hi frnds,

im very new to DTS package.

i had created the DTS package in SQL Server 2000 to read from the textfile and to populate the values in DB.

Source file is text file(delimited file with | as delimiter), destination is DB.

while inserting the records in DB . im getting the error as :

Transformcopy DTS transformation _ 1 conversion error : conevrsion invalid for datatypeson column pair 1 (Source column 'Col022(DBTYPE_STR),destination column usr_nct_timestp(DBTYPE_DBTIMESTAMP)



but i dont hvae NULL values in any of the cols.

please help me .

thnkx in advance. its urgent.

View 1 Replies View Related

Auto Insertion Of Records

Oct 4, 2007

hi, i'm quite new to sql and would like to ask if there is any way to automatically insert records from a table, for example dailyTransaction, into another table, for example transactionHistory, daily maybe around midnight or something. would also have to delete the records in dailyTransaction after it has been copied over to transactionHistory table i've done a bit of searching around and i think i have to use job to do this but i have no idea how to implement it. looked through the libary in msdn but i'm still not too sure. would really appreciate any help. thanks

View 5 Replies View Related

Data Insertion Problem

Dec 25, 2007



HI There,

I am using SQL Server 2005 and C#.Net 2005 as a front end.
I have written stored procedure to insert record into table. In that table i have field named 'TARIFF_CODE' with type 'Varchar' and size 15.

I have also written front end code with Sqlcommand object to call this sp and passed all proper required parameter values.



ICDPara = new SqlParameter();

ICDPara.ParameterName = "@Tariff_code";

ICDPara.Direction = ParameterDirection.Input;

ICDPara.SqlDbType = SqlDbType.VarChar;

ICDPara.Value = Tariff_code_act; --------------------> [e.g TR000012].

ICDPara.Size = 15;

ICDCmd.Parameters.Add(ICDPara);

But when i execute it and see it in Database i got only first 5 chars for pass value for field 'TARIFF_CODE'.

Insterestingly, it wont happens when i execute that SP through SSMS.

Please help me out.

Regards And Thanks.

View 1 Replies View Related

Check For Duplicate Records Before Insertion

Jul 19, 2006

Hi,
Does anyone have any sugestions as to the best way to achieve the following?
I want to display a list of products in a GridView. Against each product I want to place a button which will add the product to a "wish list" table.
I need to be able to check that the product has not already been inserted into the wish list.
Either suggested methods or links to tutorials will be appreciated.
Thanks in advance.
 

View 2 Replies View Related

Sql Database Data Insertion Problem.

Apr 25, 2007

Hi I have 5 tables. 1). Student 2).Student Info 3). Academics 4).Parents 5).Address. Each table has its own primary key & student Id is taken as the primary key for student Table and is used as foreign key for other tables. Now whenever i try to insert data into these tables nothing happens. I urgently require help. My project is a student database and I am not able to insert data into these tables. My Code is:-   protected void Button1_Click(object sender, EventArgs e) { SqlConnection conn; SqlCommand comm,comm1,comm2,comm3,comm4; string connectionString = ConfigurationManager.ConnectionStrings["XMG.MDFConnectionString"].ConnectionString; conn = new SqlConnection(connectionString); comm = new SqlCommand( "INSERT INTO Student (form_no,programe,date_admission,name_student,gender,caste,nationality,date_birth,place_birth,student_email,martial_status ) " + "VALUES (@form_no,@programe,@date_admission,@name_student,@gender,@caste,@nationality,@date_birth,@place_birth,@photograph,@student_email,@martial_status)", conn); comm.Parameters.Add("@form_no", System.Data.SqlDbType.Int); comm.Parameters["@form_no"].Value = formnotextbox.Text; comm.Parameters.Add("@programe", System.Data.SqlDbType.VarChar); comm.Parameters["@programe"].Value = BcaDropDownList.SelectedValue; comm.Parameters.Add("@date_admission", System.Data.SqlDbType.DateTime); comm.Parameters["@date_admission"].Value = doatextbox.Text; comm.Parameters.Add("@name_student", System.Data.SqlDbType.VarChar); comm.Parameters["@name_student"].Value = Nametextbox.Text; comm.Parameters.Add("@gender", System.Data.SqlDbType.Char); comm.Parameters["@gender"].Value = GenderDropDownList.SelectedValue; comm.Parameters.Add("@caste", System.Data.SqlDbType.VarChar); comm.Parameters["@caste"].Value = casttextbox.Text; comm.Parameters.Add("@nationality", System.Data.SqlDbType.VarChar); comm.Parameters["@nationality"].Value = nationalityTextBox.Text; comm.Parameters.Add("@date_birth", System.Data.SqlDbType.DateTime); comm.Parameters["@date_birth"].Value = sdobTextBox.Text; comm.Parameters.Add("@place_birth", System.Data.SqlDbType.VarChar); comm.Parameters["@place_birth"].Value = pobTextBox.Text; comm.Parameters.Add("@student_email", System.Data.SqlDbType.VarChar); comm.Parameters["@student_email"].Value = emailTextBox.Text; comm.Parameters.Add("@martial_status", System.Data.SqlDbType.Bit); comm.Parameters["@martial_status"].Value = maritalstatusDropDownList.SelectedValue; comm1 = new SqlCommand("INSERT INTO Student info(spouse_name,spouse_dob,marriage_anniversary,student_emp_status,name_organ,designation,nature_of_job,office_address,date_of_joining,joined_as,salary,parent_marriage_anniversary,Category,Physically_Challenged,Blood_Group,donate_blood,Height,Weight,complextion,Anthropometric_Details,Membership_in_club,club_designation,relative_mats,name_of_relative,relative_programme,relative_designation,relative_institutions,relative_class ) " + "VALUES (@spouse_name,@spouse_dob,@marriage_anniversary,@student_emp_status,@name_organ,@designation,@nature_of_job,@office_address,@date_of_joining,@joined_as,@salary,@parent_marriage_anniversary,@Category,@Physically_Challenged,@Blood_Group,@donate_blood,@Height,@Weight,@complextion,@Anthropometric_Details,@Membership_in_club,@club_designation,@relative_mats,@name_of_relative,@relative_programme,@relative_designation,@relative_institutions,@relative_class)", conn); comm1.Parameters.Add("@spouse_name", System.Data.SqlDbType.VarChar); comm1.Parameters["@spouse_name"].Value = SpousenameTextBox.Text; comm1.Parameters.Add("@spouse_dob", System.Data.SqlDbType.DateTime); comm1.Parameters["@spouse_dob"].Value = dobTextBox.Text; comm1.Parameters.Add("@marriage_anniversary", System.Data.SqlDbType.DateTime); comm1.Parameters["@marriage_anniversary"].Value = anniversaryTextBox.Text; comm1.Parameters.Add("@student_emp_status", System.Data.SqlDbType.Bit); comm1.Parameters["@student_emp_status"].Value = employeestatesTextBox.Text; comm1.Parameters.Add("@name_organ", System.Data.SqlDbType.VarChar); comm1.Parameters["@name_organ"].Value = organisationnameTextBox.Text; comm1.Parameters.Add("@designation", System.Data.SqlDbType.VarChar); comm1.Parameters["@designation"].Value = designationTextBox.Text; comm1.Parameters.Add("@nature_of_job", System.Data.SqlDbType.VarChar); comm1.Parameters["@nature_of_job"].Value = snatureofjobTextBox.Text; comm1.Parameters.Add("@date_of_joining", System.Data.SqlDbType.DateTime); comm1.Parameters["@date_of_joining"].Value = sdateofjoiningTextBox.Text; comm1.Parameters.Add("@office_address", System.Data.SqlDbType.VarChar); comm1.Parameters["@office_address"].Value = sofficeaddressTextBox.Text; comm1.Parameters.Add("@joined_as", System.Data.SqlDbType.VarChar); comm1.Parameters["@joined_as"].Value = sjoinedasTextBox.Text; comm1.Parameters.Add("@salary", System.Data.SqlDbType.Int); comm1.Parameters["@salary"].Value = ssalaryTextBox.Text; comm1.Parameters.Add("@parent_marriage_anniversary", System.Data.SqlDbType.DateTime); comm1.Parameters["@parent_marriage_anniversary"].Value = parentmarriageanniversaryTextBox.Text; comm1.Parameters.Add("@Category", System.Data.SqlDbType.Char); comm1.Parameters["@Category"].Value = categoryTextBox.Text; comm1.Parameters.Add("@Physically_Challenged", System.Data.SqlDbType.Bit); comm1.Parameters["@Physically_Challenged"].Value = physicallychallengedTextBox.Text; comm1.Parameters.Add("@Blood_Group", System.Data.SqlDbType.Char); comm1.Parameters["@Blood_Group"].Value = sbloodgroupTextBox.Text; comm1.Parameters.Add("@donate_blood", System.Data.SqlDbType.Bit); comm1.Parameters["@donate_blood"].Value = donateDropDown.SelectedValue; comm1.Parameters.Add("@Height", System.Data.SqlDbType.Decimal); comm1.Parameters["@Height"].Value = heightTextBox.Text; comm1.Parameters.Add("@Weight", System.Data.SqlDbType.Int); comm1.Parameters["@Weight"].Value = weightTextBox.Text; comm1.Parameters.Add("@complextion", System.Data.SqlDbType.VarChar); comm1.Parameters["@complextion"].Value = complextionTextBox.Text; comm1.Parameters.Add("@Anthropometric_Details", System.Data.SqlDbType.Char); comm1.Parameters["@Anthropometric_Details"].Value = AnthroprometicDetailsTextBox.Text; comm1.Parameters.Add("@Membership_in_club", System.Data.SqlDbType.Bit); comm1.Parameters["@Membership_in_club"].Value = MembersshipinclubTextBox.Text; comm1.Parameters.Add("@club_name", System.Data.SqlDbType.VarChar); comm1.Parameters["@club_name"].Value = ClubNameTextBox.Text; comm1.Parameters.Add("@club_designation", System.Data.SqlDbType.Char); comm1.Parameters["@club_designation"].Value = ClubDesignationTextBox.Text; comm1.Parameters.Add("@relative_mats", System.Data.SqlDbType.Bit); comm1.Parameters["@relative_mats"].Value = RelativeinMatsTextBox.Text; comm1.Parameters.Add("@name_of_relative", System.Data.SqlDbType.VarChar); comm1.Parameters["@name_of_relative"].Value = NameofRelativeTextBox.Text; comm1.Parameters.Add("@relative_programme", System.Data.SqlDbType.Char); comm1.Parameters["@relative_programme"].Value = RelativeProgrammeTextBox.Text; comm1.Parameters.Add("@relative_designation", System.Data.SqlDbType.VarChar); comm1.Parameters["@relative_designation"].Value = RelativeDesignationTextBox.Text; comm1.Parameters.Add("@relative_institutions", System.Data.SqlDbType.VarChar); comm1.Parameters["@relative_institutions"].Value = RelativeInstitutiosTextBox.Text; comm1.Parameters.Add("@relative_class", System.Data.SqlDbType.Char); comm1.Parameters["@relative_class"].Value = RelativeClassTextBox.Text; comm2 = new SqlCommand("INSERT INTO Academics (High_School_Board,High_School_Institute,High_School_Percentage,High_School_Year,Higher_Secon_Board,Higher_Secon_Institute,Higher_Secon_Percentage,Higher_Secon_Year,Graduation_Board,Graduation_Institute,Graduation_Percentage,Graduation_Year,Other_Certificates,Gap,Gap_Certificate,Migration_Certificate,Character_Certificate,Other_fields,Level_of_fields ) " + "VALUES (@High_School_Board,@High_School_Institute,@High_School_Percentage,@High_School_Year,@Higher_Secon_Board,@Higher_Secon_Institute,@Higher_Secon_Percentage,@Higher_Secon_Year,@Graduation_Board,@Graduation_Institute,@Graduation_Percentage,@Graduation_Year,@Other_Certificates,@Gap,@Gap_Certificate,@Migration_Certificate,@Character_Certificate,@Other_fields,@Level_of_fields)", conn); comm2.Parameters.Add("@High_School_Board", System.Data.SqlDbType.VarChar); comm2.Parameters["@High_School_Board"].Value = HighSchoolBoardtextbox.Text; comm2.Parameters.Add("@High_School_Institute", System.Data.SqlDbType.VarChar); comm2.Parameters["@High_School_Institute"].Value = HighSchoolInstitutionTextBox.Text; comm2.Parameters.Add("@High_School_Percentage", System.Data.SqlDbType.Decimal); comm2.Parameters["@High_School_Percentage"].Value = HighSchoolpercentageTextBox.Text; comm2.Parameters.Add("@High_School_Year", System.Data.SqlDbType.Int); comm2.Parameters["@High_School_Year"].Value = HighSchoolYearTextBox.Text; comm2.Parameters.Add("@Higher_Secon_Board", System.Data.SqlDbType.VarChar); comm2.Parameters["@Higher_Secon_Board"].Value = HigherSecondaryBordTextBox.Text; comm2.Parameters.Add("@Higher_Secon_Institute", System.Data.SqlDbType.VarChar); comm2.Parameters["@Higher_Secon_Institute"].Value = HigherSecondaryinstituteTextBox.Text; comm2.Parameters.Add("@Higher_Secon_Percentage", System.Data.SqlDbType.Decimal); comm2.Parameters["@Higher_Secon_Percentage"].Value = HigherSecondarypercentageTextBox.Text; comm2.Parameters.Add("@Higher_Secon_Year", System.Data.SqlDbType.Int); comm2.Parameters["@Higher_Secon_Year"].Value = HigherSecondaryYearTextBox.Text; comm2.Parameters.Add("@Graduation_Board", System.Data.SqlDbType.Text); comm2.Parameters["@Graduation_Board"].Value = GraduationBoardTextBox.Text; comm2.Parameters.Add("@Graduation_Institute", System.Data.SqlDbType.VarChar); comm2.Parameters["@Graduation_Institute"].Value = GraduationInstituteTextBox.Text; comm2.Parameters.Add("@Graduation_Percentage", System.Data.SqlDbType.Decimal); comm2.Parameters["@Graduation_Percentage"].Value = GraduationPercentageTextBox.Text; comm2.Parameters.Add("@Graduation_Year", System.Data.SqlDbType.Int); comm2.Parameters["@Graduation_Year"].Value = GraduationYearTextBox.Text; comm2.Parameters.Add("@Gap", System.Data.SqlDbType.Bit); comm2.Parameters["@Gap"].Value = gapeDropDownList.Text; comm2.Parameters.Add("@Gap_Certificate", System.Data.SqlDbType.Bit); comm2.Parameters["@Gap_Certificate"].Value = GapCertificateTextBox.Text; comm2.Parameters.Add("@Migration_Certificate", System.Data.SqlDbType.Bit); comm2.Parameters["@Migration_Certificate"].Value = MigrationCertificateTextBox.Text; comm2.Parameters.Add("@Character_Certificate", System.Data.SqlDbType.Bit); comm2.Parameters["@Character_Certificate"].Value = CharacterCertificateTextBox.Text; comm2.Parameters.Add("@Other_fields", System.Data.SqlDbType.Text); comm2.Parameters["@Other_fields"].Value = OtherFildTextBox.Text; comm2.Parameters.Add("@Level_of_fields", System.Data.SqlDbType.Text); comm2.Parameters["@Level_of_fields"].Value = LevelOfFildsTextBox.Text; comm2.Parameters.Add("@Other_Certificates", System.Data.SqlDbType.Text); comm2.Parameters["@Other_Certificates"].Value = OthercertificateTextBox.Text; comm3 = new SqlCommand("INSERT INTO Parents (father_name,father_dob,father_photograph,father_blood_group,father_job_status,Fname_organization,Fdesignation,Fnature_of_job,Foff_address,Fdate_joining,Fjoined_as,Fsalary,Fname_firm,Ffirm_established,Fdeals_in,Fannual_turn_over,Fincome,Fbusness_off_address,Fcontact_no,Fmobile_no,F_Email,Mother_Name,Mother_dob,Mother_Photograph,Mother_Blood_Group,Mother_Work_Status,Name_Organization,MDesignation,Moffice_address,Mcontact_no,Mdate_joining,Joined_As,Salary_Drawn,M_annualincome,M_Email,M_Mobileno ) " + "VALUES (@father_name,@father_dob,@father_photograph,@father_blood_group,@father_job_status,@Fname_organization,@Fdesignation,@Fnature_of_job,@Foff_address,@Fdate_joining,@Fjoined_as,@Fsalary,@Fname_firm,@Ffirm_established,@Fdeals_in,@Fannual_turn_over,@Fincome,@Fbusness_off_address,@Fcontact_no,@Fmobile_no,@F_Email,@Mother_Name,@Mother_dob,@Mother_Photograph,@Mother_Blood_Group,@Mother_Work_Status,@Name_Organization,@MDesignation,@Moffice_address,@Mcontact_no,@Mdate_joining,@Joined_As,@Salary_Drawn,@M_annualincome,@M_Email,@M_Mobileno)", conn); comm3.Parameters.Add("@father_name", System.Data.SqlDbType.VarChar); comm3.Parameters["@father_name"].Value = Fnametextbox.Text; comm3.Parameters.Add("@father_dob", System.Data.SqlDbType.DateTime); comm3.Parameters["@father_dob"].Value = fDateOfBirthTextBox.Text; comm3.Parameters.Add("@father_photograph", System.Data.SqlDbType.Image); comm3.Parameters["@father_photograph"].Value = PhotographTextBox.Text; comm3.Parameters.Add("@father_blood_group", System.Data.SqlDbType.Char); comm3.Parameters["@father_blood_group"].Value = BloodGroupTextBox.Text; comm3.Parameters.Add("@father_job_status", System.Data.SqlDbType.VarChar); comm3.Parameters["@father_job_status"].Value = JobStatusTextBox.Text; comm3.Parameters.Add("@Fname_organization", System.Data.SqlDbType.VarChar); comm3.Parameters["@Fname_organization"].Value = NameofOrgationTextBox.Text; comm3.Parameters.Add("@Fdesignation", System.Data.SqlDbType.VarChar); comm3.Parameters["@Fdesignation"].Value = fDesignationTextBox.Text; comm3.Parameters.Add("@Fnature_of_job", System.Data.SqlDbType.VarChar); comm3.Parameters["@Fnature_of_job"].Value = NatureofJobTextBox.Text; comm3.Parameters.Add("@Foff_address", System.Data.SqlDbType.VarChar); comm3.Parameters["@Foff_address"].Value = OfficeAddressTextBox.Text; comm3.Parameters.Add("@Fdate_joining", System.Data.SqlDbType.DateTime); comm3.Parameters["@Fdate_joining"].Value = DateofJoiningTextBox.Text; comm3.Parameters.Add("@Fjoined_as", System.Data.SqlDbType.VarChar); comm3.Parameters["@Fjoined_as"].Value = JoinedasTextBox.Text; comm3.Parameters.Add("@Fsalary", System.Data.SqlDbType.Int); comm3.Parameters["@Fsalary"].Value = SalaryTextBox.Text; comm3.Parameters.Add("@Fname_firm", System.Data.SqlDbType.VarChar); comm3.Parameters["@Fname_firm"].Value = NameofFirmTextBox.Text; comm3.Parameters.Add("@Ffirm_established", System.Data.SqlDbType.Int); comm3.Parameters["@Ffirm_established"].Value = firmEstablishedTextBox.Text; comm3.Parameters.Add("@Fdeals_in", System.Data.SqlDbType.Int); comm3.Parameters["@Fdeals_in"].Value = dealsinTextBox.Text; comm3.Parameters.Add("@Fannual_turn_over", System.Data.SqlDbType.Int); comm3.Parameters["@Fannual_turn_over"].Value = AnnualTurnOverTextBox.Text; comm3.Parameters.Add("@Fincome", System.Data.SqlDbType.Int); comm3.Parameters["@Fincome"].Value = IncomeTextBox.Text; comm3.Parameters.Add("@Fbusness_off_address", System.Data.SqlDbType.VarChar); comm3.Parameters["@Fbusness_off_address"].Value = BoAddressTextBox.Text; comm3.Parameters.Add("@Fcontact_no", System.Data.SqlDbType.BigInt); comm3.Parameters["@Fcontact_no"].Value = ContactNumberTextBox.Text; comm3.Parameters.Add("@Fmobile_no", System.Data.SqlDbType.BigInt); comm3.Parameters["@Fmobile_no"].Value = MobileNumberTextBox.Text; comm3.Parameters.Add("@F_Email", System.Data.SqlDbType.Text); comm3.Parameters["@F_Email"].Value = EmailIdTextBox.Text; comm3.Parameters.Add("@Mother_Name", System.Data.SqlDbType.Text); comm3.Parameters["@Mother_Name"].Value = MnameTextBox.Text; comm3.Parameters.Add("@Mother_dob", System.Data.SqlDbType.DateTime); comm3.Parameters["@Mother_dob"].Value = MdobTextBox.Text; comm3.Parameters.Add("@Mother_Photograph", System.Data.SqlDbType.Image); comm3.Parameters["@Mother_Photograph"].Value = HighSchoolInstitutionTextBox.Text; comm3.Parameters.Add("@Mother_Blood_Group", System.Data.SqlDbType.Text); comm3.Parameters["@Mother_Blood_Group"].Value = MbloodgroupTextBox.Text; comm3.Parameters.Add("@Mother_Work_Status", System.Data.SqlDbType.Char); comm3.Parameters["@Mother_Work_Status"].Value = MworkstatusTextBox.Text; comm3.Parameters.Add("@Name_Organization", System.Data.SqlDbType.VarChar); comm3.Parameters["@Name_Organization"].Value = MnameofOrgationTextBox.Text; comm3.Parameters.Add("@MDesignation", System.Data.SqlDbType.Text); comm3.Parameters["@MDesignation"].Value = MdesignationTextBox.Text; comm3.Parameters.Add("@Moffice_address", System.Data.SqlDbType.VarChar); comm3.Parameters["@Moffice_address"].Value = MofficeAddressTextBox.Text; comm3.Parameters.Add("@Mcontact_no", System.Data.SqlDbType.BigInt); comm3.Parameters["@Mcontact_no"].Value = McontactnoTextBox.Text; comm3.Parameters.Add("@Mdate_joining", System.Data.SqlDbType.DateTime); comm3.Parameters["@Mdate_joining"].Value = MdateofjoiningTextBox.Text; comm3.Parameters.Add("@Joined_As", System.Data.SqlDbType.Char); comm3.Parameters["@Joined_As"].Value = MjoiningasTextBox.Text; comm3.Parameters.Add("@Salary_Drawn", System.Data.SqlDbType.Float); comm3.Parameters["@Salary_Drawn"].Value = MSalarydrwnTextBox.Text; comm3.Parameters.Add("@M_annualincome", System.Data.SqlDbType.Float); comm3.Parameters["@M_annualincome"].Value = MAnnualincomeTextBox.Text; comm3.Parameters.Add("@M_Email", System.Data.SqlDbType.Text); comm3.Parameters["@M_Email"].Value = MemailidTextBox.Text; comm3.Parameters.Add("@M_Mobileno", System.Data.SqlDbType.BigInt); comm3.Parameters["@M_Mobileno"].Value = mmnoTextBox.Text; comm4 = new SqlCommand("INSERT INTO Address (Residential_Address,City,State,Country,Phone_No,Fax_No,Permanent_Address,Permanent_City,Permanent_State,Permanent_Country,Name_L_Guardian,Guardian_Address,Contact_Number,Relation_L_Guardian,Photograph_L_Guardian,Hostel_Details ) " + "VALUES (@Residential_Address,@City,State,@Country,@Phone_No,@Fax_No,@Permanent_Address,@Permanent_City,@Permanent_State,@Permanent_Country,@Name_L_Guardian,@Guardian_Address,@Contact_Number,@Relation_L_Guardian,@Photograph_L_Guardian,@Hostel_Details)", conn); comm4.Parameters.Add("@Residential_Address", System.Data.SqlDbType.VarChar); comm4.Parameters["@Residential_Address"].Value = ResidentialAddressTextBox.Text; comm4.Parameters.Add("@City", System.Data.SqlDbType.VarChar); comm4.Parameters["@City"].Value = cityTextBox.Text; comm4.Parameters.Add("@State", System.Data.SqlDbType.VarChar); comm4.Parameters["@State"].Value = stateTextBox.Text; comm4.Parameters.Add("@Country", System.Data.SqlDbType.VarChar); comm4.Parameters["@Country"].Value = CountryTextBox.Text; comm4.Parameters.Add("@Phone_No", System.Data.SqlDbType.BigInt); comm4.Parameters["@Phone_No"].Value = PhonenumberTextBox.Text; comm4.Parameters.Add("@Fax_No", System.Data.SqlDbType.BigInt); comm4.Parameters["@Fax_No"].Value = FaxnumberTextBox.Text; comm4.Parameters.Add("@Permanent_Address", System.Data.SqlDbType.VarChar); comm4.Parameters["@Permanent_Address"].Value = PermanentAdressTextBox.Text; comm4.Parameters.Add("@Permanent_City", System.Data.SqlDbType.VarChar); comm4.Parameters["@Permanent_City"].Value = PermanentcityTextBox.Text; comm4.Parameters.Add("@Permanent_State", System.Data.SqlDbType.VarChar); comm4.Parameters["@Permanent_State"].Value = PermanentStateTextBox.Text; comm4.Parameters.Add("@Permanent_Country", System.Data.SqlDbType.VarChar); comm4.Parameters["@Permanent_Country"].Value = PermanentCountryTextBox.Text; comm4.Parameters.Add("@Name_L_Guardian", System.Data.SqlDbType.VarChar); comm4.Parameters["@Name_L_Guardian"].Value = NameofLocalGuardianTextBox.Text; comm4.Parameters.Add("@Guardian_Address", System.Data.SqlDbType.VarChar); comm4.Parameters["@Guardian_Address"].Value = GuardianAddressTextBox.Text; comm4.Parameters.Add("@Contact_Number", System.Data.SqlDbType.BigInt); comm4.Parameters["@Contact_Number"].Value = GContactTextBox.Text; comm4.Parameters.Add("@Relation_L_Guardian", System.Data.SqlDbType.VarChar); comm4.Parameters["@Relation_L_Guardian"].Value = relationloTextBox.Text; comm4.Parameters.Add("@Photograph_L_Guardian", System.Data.SqlDbType.Image); comm4.Parameters["@Photograph_L_Guardian"].Value = SpousenameTextBox.Text; comm4.Parameters.Add("@Hostel_Details", System.Data.SqlDbType.VarChar); comm4.Parameters["@Hostel_Details"].Value = HostalDetailTextBox.Text; try { conn.Open(); comm.ExecuteNonQuery(); comm1.ExecuteNonQuery(); comm2.ExecuteNonQuery(); comm3.ExecuteNonQuery(); comm4.ExecuteNonQuery(); Response.Redirect("HelpDesk.aspx"); } catch { } finally { conn.Close(); } }} PLEASE HELP ME. I AM IN TROUBLE.     

View 3 Replies View Related

DataTable And Stored Procedure Insertion

Apr 29, 2007

hi,
How can I insert a DataTable as a whole into the Database (into an existing table) using a stored procedure?
can I just send the DataTable as a parameter to the procedure?
how can I do it?
thanx

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved