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


ADVERTISEMENT

Configure Data Source Insertion Into SQL Server 2005 Database - Express Editions

Sep 12, 2006

I am attempting to insert information from Visual Web Developer 2005 using either the Gridview or Datalist controls into a SQL Server 2005 database and get stuck when defining the custom statement.When I enter the text within the insert tab, the <next> button remains greyed out, preventing me from continuing to the next page.If I copy the same text into the select tab, then I can continue with the wizard, however this raises other problems which may or may not be related (multiple insertions of the data into the SQL Server database table - possibly due to postback functions). I would rather use insert to confirm that my second problem is not because I am using the wrong option.My question is:Should I be able to use the insert function within VWD express or is this only available within the standard/pro editions?

View 2 Replies View Related

Data Flow Stuck In Phase The Final Commit Data Insertion Has Started

Jun 19, 2007

Hello,



I have noticed that for one of my data-flows, the process is really long during the phase "the final commit data insertion has started".

To be accurate, the process is fast until it reaches this phase. It happens often when I load millions of lines.



The extraction is done from a database SQL Server 2005 to a database SQL Server 2005, on the same server (with the SQL Server native provider).

I used a SQL Server destination but I have tried with an OLE DB destination and it is the same situation.



Why the process could be so long during this phase?

There is a way to optimised my package to avoid that?



Any idea is welcome.



Thanks.

Guillaume

View 6 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

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

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

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

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

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

Connecting To Database For Bulk Insertion

Oct 20, 2007

HI friends,
    I am retrieving oracle data(linked server) to my local sql server 2005. Initially I want to have duplicate copy of the oracle data to my local server. I have created linked server and inserting to my local table(exact replica). This will run for every 2 minutes(as per my client requirement) to get newly added records.
But, I want to retrieve specific columns from the replicated table and insert into other local tables. i have written a SP to do this. some columns are storing in other tables to maintain normalization. this should also run for every two minutes.
I have written a class (c#) to retrieve replica table and passing parameters to SP and inserting to my local tables in normalized form.
But this is taking 10 minutes to complete my process to insert 1500 records. but my client insist to reduce the speed to run for every 2 mins.
is it correct way wat i am doing? or any other solution is there?
pls suggest me.
thanks in advance

View 1 Replies View Related

Data Insertion Failure. Help Much Appreciated.

Jan 3, 2008

Hi everybody.I'm having difficulties with a button handler I put together from a few examples around the internet.Here's my code: <script runat="server">                Sub Add_To_Cart(ByVal Src As Object, ByVal Args As EventArgs)                       Dim FVArtikel_id As Label = FormViewDisplay.FindControl("Artikel_idLabel")        Dim FVArtikel_naam As Label = FormViewDisplay.FindControl("Artikel_naamLabel")        Dim FVArtikel_prijs As Label = FormViewDisplay.FindControl("Artikel_prijsLabel")        Dim DBConnection As OleDbConnection        Dim DBCommand As OleDbCommand        Dim SQLString As String        Dim SQLAddString As String          If Not Session("sid") Is Nothing Then                                DBConnection = New OleDbConnection( _              "Provider=Microsoft.Jet.OLEDB.4.0;" & _              "Data Source=C:Documents and SettingsAdministratorBureaublad2ehandslego.nldatadb.mdb")                        DBConnection.Open()                        SQLString = "SELECT Count(*) FROM Orders WHERE sid = '" & CType(Session("sid"), String) & "' AND Artikel_id = '" & FVArtikel_id.Text & "'"                        DBCommand = New OleDbCommand(SQLString, DBConnection)                        DBCommand.Parameters.AddWithValue("@sid", Session("sid"))                             'string?             DBCommand.Parameters.AddWithValue("@Artikel_id", FVArtikel_id.Text)                 'string?                         If DBCommand.ExecuteScalar() = 0 Then                    SQLAddString = "INSERT INTO Orders (sid, Order_datum, " & _                  "Artikel_id, Order_artikel, Order_prijs, Order_hoeveelheid) VALUES (" & _                  "'" & Session("sid") & "', " & _                  "'" & Today & "', " & _                  "'" & FVArtikel_id.Text & "', " & _                  "'" & FVArtikel_naam.Text & "', " & _                  "'" & FVArtikel_prijs.Text & "',  1)"                                DBCommand = New OleDbCommand(SQLAddString, DBConnection)                                DBCommand.Parameters.AddWithValue("@sid", Session("sid"))                         'string?                 DBCommand.Parameters.AddWithValue("@Artikel_id", FVArtikel_id.Text)             'string?                 DBCommand.Parameters.AddWithValue("@Artikel_naam", FVArtikel_naam.Text)                DBCommand.Parameters.AddWithValue("@Artikel_prijs", FVArtikel_prijs.Text)       'string?                                 DBCommand.ExecuteNonQuery()                End If                        DBConnection.Close()              Src.Text = "Item Added"            Src.ForeColor = Color.FromName("#990000")            Src.BackColor = Color.FromName("#E0E0E0")            Src.Font.Bold = True                    End If            End Sub</script> I'm not getting any errors, it seems to me that i'm not getting a 'sid' value passed along but i don't know what to do about it.I've also already tried step debugging. This is my last resort. I hope you can help me.

View 3 Replies View Related

How To Prevent The Insertion Of The Same Entry Of An Unique Value Into The Database

Jun 4, 2008

how to prevent the insertion of the same entry of an unique value into the database?
assume that I have a primary key username " abc"  in the database
and then I insert the "abc" again ,the debuggging error msg pops out saying the primary key cannot be duplicated..
how can I do an if--else statement to check the database against this unintentional inputs of the same unique data " abc"???
 

View 7 Replies View Related

Insertion Data Via Stored Procedure [URGENT]!!

Oct 15, 2004

Hi all;

Question:
=======
Q1) How can I insert a record into a table "Parent Table" and get its ID (its PK) (which is an Identity "Auto count" column) via one Stored Procedure??

Q2) How can I insert a record into a table "Child Table" whose (FK) is the (PK) of the "Parent Table"!! via another one Stored Procedure??


Example:
------------
I have two tables "Customer" and "CustomerDetails"..

SP1: should insert all "Customer" data and return the value of an Identity column (I will use it later in SP2).

SP2: should insert all "CustomerDetials" data in the record whose ID (the returned value from SP1) is same as ID of the "Customer" table.


FYI:
----
MS SQL Server 2000
VS.NET EA 2003
Win XP SP1a
VB.NET/ASP.NET :)


Thanks in advanced!

View 5 Replies View Related

How To Restrict Data Insertion Upto 50 MB In A Table

Feb 1, 2006

how to restrict data insertion upto 50 MB in a table?

View 1 Replies View Related

SSIS Bulk Insert For Data Insertion.

Oct 12, 2007

Hi,

I ran my package and it was successfu. I tried running it again, but this time it throws me this error:


Dim_T_Account [56575]: Unable to prepare the SSIS bulk insert for data insertion.

Error: 0xC004701A at CallerType, CallerChannel, Dealer, DODealer, HotlineType, Model, Reg'l Signal Code, Account, Contact, DTS.Pipeline: component "Dim_T_Account" (56575) failed the pre-execute phase and returned error code 0xC0202071.

Information: 0x40043008 at CallerType, CallerChannel, Dealer, DODealer, HotlineType, Model, Reg'l Signal Code, Account, Contact, DTS.Pipeline: Post Execute phase is beginning.



Why suddenly without changing anything, i encountered this error? What does it mean it cannot prepare the SSIS bulk insert. My connection to server is working ok.

cherriesh

View 9 Replies View Related

Validating The Insertion Of A Record Into Database Against Existing Records.

Jan 31, 2008

Hello. I currently have a website that allows appointments to be booked up for doctors. i currently have an insert record page built using ASP components. I would like to introduce some validation so that if a user tries to book an appointment date and time that is already occupied, an error message is returned saying that appointment slot is already booked. I'm quite confused how to do this. My current code looks as follows.
<%@ Page Language="C#" MasterPageFile="~/AdministratorMasterPage.master" AutoEventWireup="true" CodeFile="AddAppointment.aspx.cs" Inherits="AddAppointment" Title="Add Appointments - Bournemouth and Poole NHS Primary Care Trust" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<table style="position: relative">
<tr>
<td style="width: 45px">
<br />
</td>
<td style="width: 136px">
</td>
<td style="width: 47px">
</td>
<td style="width: 100px">
<asp:SqlDataSource ID="AppointmentsSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ProgConnectionString %>"
DeleteCommand="DELETE FROM [Appointment] WHERE [PatientNo] = @PatientNo" InsertCommand="INSERT INTO [Appointment] ([PatientNo], [PatientSurname], [PatientForename], [ConsultantName], [HospitalName], [Time], [Date], [AppointmentStatus]) VALUES (@PatientNo, @PatientSurname, @PatientForename, @ConsultantName, @HospitalName, @Time, @Date, @AppointmentStatus)"
SelectCommand="SELECT * FROM [Appointment]" UpdateCommand="UPDATE [Appointment] SET [ConsultantName] = @ConsultantName, [HospitalName] = @HospitalName, [Time] = @Time, [Date] = @Date, [AppointmentStatus] = @AppointmentStatus WHERE [PatientNo] = @PatientNo">
<DeleteParameters>
<asp:Parameter Name="PatientNo" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="ConsultantName" Type="String" />
<asp:Parameter Name="HospitalName" Type="String" />
<asp:Parameter Name="Time" Type="DateTime" />
<asp:Parameter Name="Date" Type="DateTime" />
<asp:Parameter Name="PatientNo" Type="Int32" />
<asp:Parameter Name="AppointmentStatus" Type="String" />
</UpdateParameters>
<InsertParameters>
<asp:ControlParameter ControlID="Textbox1" Name="PatientNo" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="Textbox3" Name="PatientSurname" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="Textbox4" Name="PatientForename" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="DropDownList1" Name="ConsultantName" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="DropDownList2" Name="HospitalName" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="DropDownList3" Name="Time" PropertyName="Text" Type="DateTime" />
<asp:ControlParameter ControlID="Textbox2" Name="Date" PropertyName="Text" Type="DateTime" />
<asp:ControlParameter ControlID="DropDownList4" Name="AppointmentStatus" PropertyName="Text" Type="String" />
</InsertParameters>
</asp:SqlDataSource>
</td>
<td style="width: 100px">
</td>
<td style="width: 100px">
</td>
</tr>
<tr>
<td style="width: 45px">
</td>
<td align="left" style="width: 136px">
<asp:Label ID="Label1" runat="server" Style="position: relative" Text="Patient No"></asp:Label></td>
<td style="width: 47px">
</td>
<td style="width: 100px">
<asp:TextBox ID="TextBox1" runat="server" Style="position: relative"></asp:TextBox></td>
<td style="width: 100px">
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox1"
Display="Dynamic" ErrorMessage="RequiredFieldValidator" Style="position: relative"
Width="148px">Enter a Patient No</asp:RequiredFieldValidator></td>
<td style="width: 100px">
</td>
</tr>
<tr>
<td style="width: 45px">
</td>
<td align="left" style="width: 136px">
</td>
<td style="width: 47px">
</td>
<td style="width: 100px">
<br />
</td>
<td style="width: 100px">
</td>
<td style="width: 100px">
</td>
</tr>
<tr>
<td style="width: 45px">
</td>
<td align="left" style="width: 136px">
<asp:Label ID="Label6" runat="server" Style="position: relative" Text="Patient Surname"
Width="116px"></asp:Label></td>
<td style="width: 47px">
</td>
<td style="width: 100px">
<asp:TextBox ID="TextBox3" runat="server" Style="position: relative"></asp:TextBox></td>
<td style="width: 100px">
<asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="TextBox3"
ErrorMessage="Enter a Surname" Style="position: relative" Width="140px"></asp:RequiredFieldValidator></td>
<td style="width: 100px">
</td>
</tr>
<tr>
<td style="width: 45px">
</td>
<td align="left" style="width: 136px">
<br />
</td>
<td style="width: 47px">
</td>
<td style="width: 100px">
</td>
<td style="width: 100px">
</td>
<td style="width: 100px">
</td>
</tr>
<tr>
<td style="width: 45px">
</td>
<td align="left" style="width: 136px">
<asp:Label ID="Label7" runat="server" Style="position: relative" Text="Patient Forename"
Width="128px"></asp:Label></td>
<td style="width: 47px">
</td>
<td style="width: 100px">
<asp:TextBox ID="TextBox4" runat="server" Style="position: relative"></asp:TextBox></td>
<td style="width: 100px">
<asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ControlToValidate="TextBox4"
ErrorMessage="Enter a Forename" Style="position: relative"></asp:RequiredFieldValidator></td>
<td style="width: 100px">
</td>
</tr>
<tr>
<td style="width: 45px">
</td>
<td align="left" style="width: 136px">
<br />
</td>
<td style="width: 47px">
</td>
<td style="width: 100px">
</td>
<td style="width: 100px">
</td>
<td style="width: 100px">
</td>
</tr>
<tr>
<td style="width: 45px">
</td>
<td style="width: 136px">
<asp:Label ID="Label2" runat="server" Style="position: relative" Text="Consultant Name"></asp:Label></td>
<td style="width: 47px">
</td>
<td style="width: 100px">
<asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSource1"
DataTextField="UserName" DataValueField="UserName" Style="position: relative">
<asp:ListItem Selected="True">Select...</asp:ListItem>
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ASPNETDBConnectionString %>"
SelectCommand="SELECT aspnet_Users.UserName&#13;&#10;FROM aspnet_UsersInRoles INNER JOIN&#13;&#10; aspnet_Users ON aspnet_UsersInRoles.UserId = aspnet_Users.UserId INNER JOIN&#13;&#10; aspnet_Roles ON aspnet_UsersInRoles.RoleId = aspnet_Roles.RoleId&#13;&#10;WHERE (aspnet_Roles.RoleName = 'Consultant')"></asp:SqlDataSource>
</td>
<td style="width: 100px">
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="DropDownList1"
ErrorMessage="RequiredFieldValidator" Style="position: relative" Width="152px">Select a Consultant</asp:RequiredFieldValidator></td>
<td style="width: 100px">
</td>
</tr>
<tr>
<td style="width: 45px">
</td>
<td style="width: 136px">
</td>
<td style="width: 47px">
</td>
<td style="width: 100px">
<br />
</td>
<td style="width: 100px">
</td>
<td style="width: 100px">
</td>
</tr>
<tr>
<td style="width: 45px">
</td>
<td style="width: 136px">
<asp:Label ID="Label3" runat="server" Style="position: relative" Text="Hospital Name"></asp:Label></td>
<td style="width: 47px">
</td>
<td style="width: 100px">
<asp:DropDownList ID="DropDownList2" runat="server" DataSourceID="SqlDataSource2"
DataTextField="HospitalName" DataValueField="HospitalName" Style="position: relative">
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ProgConnectionString %>"
SelectCommand="SELECT [HospitalName] FROM [Hospital]"></asp:SqlDataSource>
</td>
<td style="width: 100px">
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="DropDownList2"
ErrorMessage="RequiredFieldValidator" Style="position: relative" Width="136px">Select a Hospital</asp:RequiredFieldValidator></td>
<td style="width: 100px">
</td>
</tr>
<tr>
<td style="width: 45px">
</td>
<td style="width: 136px">
</td>
<td style="width: 47px">
</td>
<td style="width: 100px">
<br />
</td>
<td style="width: 100px">
</td>
<td style="width: 100px">
</td>
</tr>
<tr>
<td style="width: 45px">
</td>
<td style="width: 136px">
<asp:Label ID="Label4" runat="server" Style="position: relative" Text="Appointment Date"></asp:Label></td>
<td style="width: 47px">
</td>
<td style="width: 100px">
<asp:Calendar ID="Calendar1" runat="server" Font-Size="Smaller" Style="position: relative" OnSelectionChanged="Calendar1_SelectionChanged" OnDayRender="Calendar1_DayRender">
</asp:Calendar>
</td>
<td style="width: 100px">
</td>
<td style="width: 100px">
</td>
</tr>
<tr>
<td style="width: 45px">
</td>
<td style="width: 136px">
</td>
<td style="width: 47px">
</td>
<td style="width: 100px">
<asp:TextBox ID="TextBox2" runat="server" Style="position: relative; left: 0px; top: 8px;" Width="256px"></asp:TextBox><br />
</td>
<td style="width: 100px">
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="TextBox2"
Display="Dynamic" ErrorMessage="Enter a Date" Style="position: relative"></asp:RequiredFieldValidator></td>
<td style="width: 100px">
</td>
</tr>
<tr>
<td style="width: 45px">
</td>
<td style="width: 136px">
</td>
<td style="width: 47px">
</td>
<td style="width: 100px">
</td>
<td style="width: 100px">
</td>
<td style="width: 100px">
</td>
</tr>
<tr>
<td style="width: 45px; height: 26px">
</td>
<td style="width: 136px; height: 26px">
<asp:Label ID="Label5" runat="server" Style="position: relative" Text="Appointment Time" Width="132px"></asp:Label></td>
<td style="width: 47px; height: 26px">
</td>
<td style="width: 100px; height: 26px">
<asp:DropDownList ID="DropDownList3" runat="server" Style="position: relative; left: 0px; top: 0px;">
<asp:ListItem>Select...</asp:ListItem>
<asp:ListItem Value="09:00">09:00</asp:ListItem>
<asp:ListItem>09:30</asp:ListItem>
<asp:ListItem>10:00</asp:ListItem>
<asp:ListItem>10:30</asp:ListItem>
<asp:ListItem>11:00</asp:ListItem>
<asp:ListItem>11:30</asp:ListItem>
</asp:DropDownList></td>
<td style="width: 100px; height: 26px">
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="DropDownList3"
Display="Dynamic" ErrorMessage="Select a Time" Style="position: relative"></asp:RequiredFieldValidator></td>
<td style="width: 100px; height: 26px">
</td>
</tr>
<tr>
<td style="width: 45px">
</td>
<td style="width: 136px">
<br />
</td>
<td style="width: 47px">
</td>
<td style="width: 100px">
</td>
<td style="width: 100px">
</td>
<td style="width: 100px">
</td>
</tr>
<tr>
<td style="width: 45px">
</td>
<td style="width: 136px">
<asp:Label ID="Label8" runat="server" Style="position: relative" Text="Appointment Status"
Width="136px"></asp:Label></td>
<td style="width: 47px">
</td>
<td style="width: 100px">
<asp:DropDownList ID="DropDownList4" runat="server" Style="position: relative">
<asp:ListItem>Select...</asp:ListItem>
<asp:ListItem>Booked</asp:ListItem>
<asp:ListItem>Modified</asp:ListItem>
<asp:ListItem>Patient Notified</asp:ListItem>
</asp:DropDownList></td>
<td style="width: 100px">
<asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" ErrorMessage="Select a Status"
Style="position: relative" Width="120px" ControlToValidate="DropDownList4"></asp:RequiredFieldValidator></td>
<td style="width: 100px">
</td>
</tr>
<tr>
<td style="width: 45px">
</td>
<td style="width: 136px">
</td>
<td style="width: 47px">
</td>
<td style="width: 100px">
</td>
<td style="width: 100px">
</td>
<td style="width: 100px">
</td>
</tr>
<tr>
<td style="width: 45px">
</td>
<td style="width: 136px">
</td>
<td style="width: 47px">
</td>
<td align="center" style="width: 100px">
<asp:Button ID="Button1" runat="server" Style="position: relative" Text="Submit" OnClick="Button1_Click1" /></td>
<td style="width: 100px">
</td>
<td style="width: 100px">
</td>
</tr></table>
</asp:Content>
Any help would be very much appreciated.
Thanks,
James.

View 2 Replies View Related

Unable To Prepare The SSIS Bulk Insert For Data Insertion

Oct 24, 2007



Hi,

I am using SQL Server Destinations in my data flow tasks. I'm running this package in the server until i encountered this error:

OnError,,,LOAD AND UPDATE Dimension Tables,,,10/24/2007 1:22:23 PM,10/24/2007 1:22:23 PM,-1071636367,0x,Unable to prepare the SSIS bulk insert for data insertion.
OnError,,,Load Dimensions,,,10/24/2007 1:22:23 PM,10/24/2007 1:22:23 PM,-1071636367,0x,Unable to prepare the SSIS bulk insert for data insertion.
OnError,,,Discount Reason, ISIS Condition, ISIS Defect, ISIS Repair, ISIS Section, ISIS Symptom, Job Status, Parts, Purchase SubOrder Type, Service Contract, Service Reason, Service Type, TechServiceGrp, WarrantyType, Branch, Wastage Reason,,,10/24/2007 1:22:23 PM,10/24/2007 1:22:23 PM,-1073450974,0x,SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "Dim_T_ISISDefect" (56280) failed with error code 0xC0202071. The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running. There may be error messages posted before this with more information about the failure.


What could be the reason for this? I don't usually have an error.

cherriesh

View 6 Replies View Related

SQL ServerDestination Error - Unable To Prepare The SSIS Bulk Insert For Data Insertion.

Jan 15, 2008



Having searched the forum, this one clearly has form... However beyond assisting those who have fallen at the first hurdle (i.e. forgetting/not knowing that they cannot execute the package remotely to the instance of SQL Server into which they are inserting), the issues raised by others have not been addressed. Thus I am bringing nothing new to the table here - just providing an executive summary of problems which others have run into, written about, but not received answers for.

First the complete error:
Description: Unable to prepare the SSIS bulk insert for data insertion. End Error Error: 2008-01-15 04:55:27.58 Code: 0xC004701A Source: <xxx> DTS.Pipeline Description: component "<xxx> failed the pre-execute phase and returned error code 0xC0202071. End Error DTExec: The package execution returned DTSER_FAILURE (1). Started: 4:53:34 AM Finished: 5:00:00 AM Elapsed: 385.384 seconds. The package execution failed. The step failed.

Important points


It mostly works - It produces no error more than 9 times out of 10.

It fails on random dataflows - My package has several dataflows, (mostly) executing concurrently. Where the error occurs it does not do so on the same dataflow each time: on one run it'll fail on dataflow A whilst B,C,D and E succeed, then A-E will all succeed (and continue doing so for the next ten runs thereafter), and then the error recurs for dataflow D, with A,B,C and E all succeeding.
Hope someone has something interesting to say,


Tamim.

View 10 Replies View Related

ADO - Connection::Execute() Returning Zero Records Affected After Successful Insertion Of Data In SQL Server 2005

Apr 11, 2008

Hello,

For the following ADO Connection::Execute() function the "recAffected" is zero, after a successful insertion of data, in SQL Server 2005. In SQL Server Express I am getting the the number of records affected value correctly.

_variant_t recAffected;
connectionObject->Execute(SQL, &recAffected, adCmdText );

The SQL string is

BEGIN
DELETE FROM MyTable WHERE Column_1 IN ('abc', 'def' )
END
BEGIN
INSERT INTO MyTable (Column_1, Column_2, Cloumn_3 )
SELECT 'abc', 'data11', 'data12'
UNION ALL
SELECT 'def', 'data21', 'data22'
END

But see this, for SQL Server 2005 "recAffected" has the correct value of 2 when I have just the insert statement.

INSERT INTO MyTable (Column_1, Column_2, Cloumn_3 )
SELECT 'abc', 'data11', 'data12'
UNION ALL
SELECT 'def', 'data21', 'data22'

For SQL Server 2005 in both cases the table got successfully inserted two rows and the HRESULT of Execute() function returns S_OK.

Does the Execute function has any problem with a statement like the first one (with delete and insert) on a SQL Server 2005 DB?

Why the "recAffected" has a value zero for the first SQL (with delete and insert) on a SQL Server 2005 DB? Do I need to pass any options to Execute() function for a SQL Server 2005 DB?

When connecting to SQL Server Express the "recAffected" has the correct values for any type of SQL statements.

Thank you for your time. Any help greatly appreciated.

Thanks,
Kannan

View 1 Replies View Related

To Programmaticaly Delete The Extra Tabs In Text File(after Data Insertion Using SSIS Packages)

Jan 3, 2008



Hi All SSIS experts,

Happy 2008!!!!
I am inserting data into a tab delimted text file using SSIS package.
After data insetion some extra tabs get added between columns in some rows in the text file.
Can we programmatically delete the extra tabs from the text file, if so how to use/implement the code inside the SSIS package?
Any pointer/suggestions are welcome.

Thanks & Regards,

View 9 Replies View Related

ADO - Connection::Execute() Returning Zero Records Affected After Successful Insertion Of Data In SQL Server 2005

Apr 5, 2008

Hello,

For the following ADO Connection::Execute() function the "recAffected" is zero, after a successful insertion of data, in SQL Server 2005. In SQL Server Express I am getting the the number of records affected value correctly.

_variant_t recAffected;
connectionObject->Execute(SQL, &recAffected, adCmdText );

The SQL string is

BEGIN
DELETE FROM MyTable WHERE Column_1 IN ('abc', 'def' )
END
BEGIN
INSERT INTO MyTable (Column_1, Column_2, Cloumn_3 )
SELECT 'abc', 'data11', 'data12'
UNION ALL
SELECT 'def', 'data21', 'data22'
END

But see this, for SQL Server 2005 "recAffected" has the correct value of 2 when I have just the insert statement.

INSERT INTO MyTable (Column_1, Column_2, Cloumn_3 )
SELECT 'abc', 'data11', 'data12'
UNION ALL
SELECT 'def', 'data21', 'data22'

For SQL Server 2005 in both cases the table got successfully inserted two rows and the HRESULT of Execute() function returns S_OK.

Does the Execute function has any problem with a statement like the first one (with delete and insert) on a SQL Server 2005 DB?

Why the "recAffected" has a value zero for the first SQL (with delete and insert) on a SQL Server 2005 DB? Do I need to pass any options to Execute() function for a SQL Server 2005 DB?

When connecting to SQL Server Express the "recAffected" has the correct values for any type of SQL statements.

Thank you for your time. Any help greatly appreciated.

Thanks,
Kannan

View 5 Replies View Related

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

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

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 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







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