Adding New Data Fiels And Inserting Data
I have some website work lined up and it involves some simple modifications to a MS SQL 2000 server. What I'll need to do is add some new data fields and insert some data.
I have some experience with databases - MS Access and MySQL, but I have never used or seen MS SQL 2000. My question is, is this a relatively simple thing to do for someone who hasn't used it before? I can do these things quite simply in Access or MySQL, so is MS SQL 2000 going to be any different?
Also, does anyone know of any free tutorials online that would help me out?
Thanks
View Complete Forum Thread with Replies
Related Forum Messages:
How Can I See The Data Of Some Fiels?
Hello, I'm new using ASP NET , after I created a local application Visual Web Developer that connect to the remote server to be able to see the data but only shows up User ID, and Email, what can i do if I want to see the rest of the fiels as name, address and phone number??What do you suggest I should do? and How encrypt the data to avoid other people read it?
View Replies !
Adding A New Data Column (not Derived) Midway Thru A Data Flow
I need to know what a table's max row Identity is part way thru a data flow. I can't get it at the beginning of the data flow. I need to either (1) add it to the data buffer part way thru or (2) set it into a package variable and then reference the var in a script component. I've not found a way to add a database column to the data buffer without doing a lookup for each row (too slow and not appropriate here) or some goofy oledb source and then merge join into the data buffer on a contrived join. I've read questions about referencing package vars in scripts but I can't get that to work. DTS.Variables("varname").Value isn't recognised when I code it up. Anyone have an idea or solution for either one of these? If you're gonna explain the script code, please include the entire snipet including the INCLUDEs, etc.
View Replies !
Inserting The Data Into Text Data Type
Hi everybody, In our datbase we have a table with text data type.Help me if anybody knows how to insert text data into text data type of sql server. i am able to modify and retrive but i am not able to insert text. please if u have idea, please give me reply asap. Thanks, Giri
View Replies !
Need Help Inserting Data In A Table That Already Has Data
I need to create a stored procedure that will insert data with some already exsisting data in a table. The data is in a spreadsheet, my issue is that I dont want to violate the primary key rules. can anyone help please CREATE PROCEDURE InsertTerms AS INSERT INTO [GamingCommissiondb].[dbo].[TERMINATION] ( [TM #], [FirstName], [LastName], [SocialSecurityNumber], [DateHired], [Status], [Title], [DepartmentName], [Pictures]) SELECT a.TM#, a.FirstName, a.LASTNAME, a.SSN#, a.HIREDATE, a.STATUS, a.JOBTITLE, a.DEPT#, a.PICS FROM EmployeeGamingLicense AS a WHERE a.STATUS = 'TERMINATED' IF @@Error <> '0' RETURN GO
View Replies !
Inserting Data
I have created a form with several fields etc and validation. After pressing the submit button i have a if Page.IsValid then .....etc But in this then bit I want to do a INSERT the form details to the db. I have done inserts etc via gridView etc but I just need a form that lets someone enter info and submit etc, so do not now where to or how to place this code to connect then insert etc thanks
View Replies !
Inserting Data Into DB
Hi friends,I have one text box on my form.i need to insert the data from tat text box to DB without clicking on any button.Now i have written the code under text changed event of that text box.So it is inserting whenever i click on that form.Besides this i need to insert data when i close tat window.But it is not inserting when i close tat window.Plse help me.Thanks in advance With RegardsLijo Rajan
View Replies !
Help On Inserting Data To DB
Hi,I m using Microsoft Visual Studio 2005 and SQL server 2000. I have 2 textboxes and a button, what i wanna do is, when i hit the button, the values in textboxes should be inserted into DB. Would you please help me? Thanks in advance.
View Replies !
Need Help Inserting Data!!
I am not looking for free code but this is driving me out of my mind. I'm a pretty proficient PHP programmer and have been dealing with a form that I was made to program in ASP.Net due to my employer's preferences. I can't attach the code for the form so I have cut and pasted it below. I am needing to know whow do I code this so that the data will go into a MS SQL 2005 database? I already have some coding in it but I don't know if it's correct and any help in getting this fixed would be great as it is slowly driving me up the wall. Thanks! <%@ Page Language="VB" %> <%@ Import Namespace="System.Data" %> <%@ Import Namespace="System.Data.SqlClient" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> Protected Sub Button_Click(ByVal sender As Object, ByVal e As System.EventArgs) Dim conebackups As SqlConnection Dim strInsert As String Dim cmdInsert As SqlCommand conebackups = New SqlConnection("Server=localhost;UID=sa;pwd=kitten33;database=ebackups") strInsert = "INSERT cust_info ( cust_name, cust_contact, cust_phone, cust_analyst, install_date, cust_username, cust_password, account_request_type, quickbooks_check, peachtree_check, mssba_check, goldmine_check, act_check, mail_info, db_info, mapped_info, mobile_data, mail_option, db_option, mapped_option, mobile_option, backupexec_option ) Values ( 'cust_name, 'cust_contact', 'cust_phone', 'cust_analyst', 'install_date', 'cust_username', 'cust_password', 'account_request_type', 'quickbooks_check', 'peachtree_check', 'mssba_check', 'goldmine_check', 'act_check', 'mail_info', 'db_info', 'mapped_info', 'mobile_data', 'mail_option', 'db_option', 'mapped_option', 'mobile_option', 'backupexec_option' )" cmdInsert = New SqlCommand(strInsert, conebackups) conebackups.Open() cmdInsert.ExecuteNonQuery() conebackups.Close() End Sub </script> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Weston Backup Questionnaire</title> <script language="javascript" type="text/javascript"> </script> </head> <body> <form id="westonquest" runat="server"> <div> <div style="border-left-color: black; border-bottom-color: black; border-top-color: black; text-align: center; border-right-color: black" title="Weston Backup Questionnaire"> <table> <tr> <td colspan="3" style="width: 540px; height: 30px; text-align: center"> <span style="font-size: 14pt; font-family: Verdana">Weston Online Backup Questionnaire</span></td> </tr> <tr> <td colspan="3" style="width: 540px; height: 10px; text-align: left"> <hr /> <span style="font-size: 8pt; font-family: Verdana">Please fill out the following information as accurately as possible. Any incorrect information may affect the customers online backup in a serious manner. All of the following fields require an answer before you can submit the form.<br /> </span></td> </tr> <tr> <td colspan="3" style="width: 540px; height: 21px"> <br /> <span style="font-size: 14pt; font-family: Verdana">Customer and Analyst Information</span></td> </tr> <tr> <td colspan="3" style="width: 540px; height: 21px; text-align: left"> <hr /> <span style="font-size: 8pt; font-family: Verdana">Customer Name:<br /> </span> <asp:DropDownList ID="cust_name" runat="server" Font-Names="Verdana" Font-Size="X-Small" Width="232px" DataSourceID="SqlDataSource1" DataTextField="cust_name" DataValueField="cust_name"> <asp:ListItem>Select Customer Name.....</asp:ListItem> <asp:ListItem Value="WestonANC">Weston - ANC</asp:ListItem> <asp:ListItem Value="WestonBND">Weston - BND</asp:ListItem> </asp:DropDownList><asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ebackupsConnectionString %>" SelectCommand="SELECT [cust_name] FROM [backup_info]"></asp:SqlDataSource> <span style="font-size: 8pt; font-family: Verdana"> <br /> <br /> Customer Contact: Customer Phone Number:<br /> <asp:TextBox ID="cust_contact" runat="server" Font-Names="Verdana" Font-Size="X-Small" Width="190px"></asp:TextBox> <asp:TextBox ID="cust_phone" runat="server" Font-Names="Verdana" Font-Size="X-Small" Width="146px"></asp:TextBox><br /> <br /> Analyst: Today's Date: (mm/dd/yyy format)<br /> <asp:DropDownList ID="cust_analyst" runat="server" Font-Names="Verdana" Font-Size="X-Small" Width="162px"> <asp:ListItem>Select Analyst.....</asp:ListItem> <asp:ListItem>Brock McFarlane</asp:ListItem> <asp:ListItem>Cameron Farrally</asp:ListItem> <asp:ListItem>Eric Spinney</asp:ListItem> <asp:ListItem>Greg Freeman</asp:ListItem> <asp:ListItem>Kevin Mark</asp:ListItem> <asp:ListItem>Mark Anderson</asp:ListItem> <asp:ListItem>Mike Murphy</asp:ListItem> <asp:ListItem>Tim Elder</asp:ListItem> </asp:DropDownList> <asp:TextBox ID="install_date" runat="server" Font-Names="Verdana" Font-Size="X-Small"></asp:TextBox><br /> <br /> Customer E-Backup Username: Customer E-Backup Password:<br /> <asp:TextBox ID="cust_username" runat="server" Font-Names="Verdana" Font-Size="X-Small" Width="150px"></asp:TextBox> <asp:TextBox ID="cust_password" runat="server" Font-Names="Verdana" Font-Size="X-Small" Width="150px" TextMode="Password"></asp:TextBox><br /> <br /> <asp:RadioButtonList ID="account_request_type" runat="server" Font-Names="Verdana" Font-Size="X-Small" RepeatDirection="Horizontal" Width="430px"> <asp:ListItem Value="New">New Account</asp:ListItem> <asp:ListItem Value="Change">Account Change</asp:ListItem> <asp:ListItem Value="Delete">Account Deletion</asp:ListItem> </asp:RadioButtonList></span><br /> </td> </tr> <tr> <td colspan="3" style="width: 540px; height: 21px; text-align: center;"> <span style="font-size: 14pt; font-family: Verdana">Financial / CRM Programs</span></td> </tr> <tr> <td colspan="3" style="width: 540px; height: 21px; text-align: left"> <hr /> <span style="font-size: 8pt; font-family: Verdana">Does the customer use any of the following financial / CRM products?<br /> <br /> Quickbooks<asp:CheckBox ID="quickbooks_check" runat="server" /> Peachtree Accounting<asp:CheckBox ID="peachtree_check" runat="server" /> MS Small Business Acct<asp:CheckBox ID="mssba_check" runat="server" /> <br /> Sage Goldmine<asp:CheckBox ID="goldmine_check" runat="server" /> Sage ACT!<asp:CheckBox ID="act_check" runat="server" /><br /> <br /> <br /> </span></td> </tr> <tr> <td colspan="3" style="width: 540px; height: 21px; text-align: center"> <span style="font-size: 14pt; font-family: Verdana">BackupExec / NTBackup</span></td> </tr> <tr> <td colspan="3" style="width: 540px; height: 21px; text-align: left"> <hr /> <span style="font-size: 8pt; font-family: Verdana">Does the customer use BackupExec, NTBackup or any other backup software? </span><span style="color: #ff0066"><span style="font-size: 8pt; font-family: Verdana">(Important!)<br /> <br /> </span> <asp:RadioButtonList ID="backupexec_option" runat="server" Font-Names="Verdana" Font-Size="X-Small" ForeColor="Black" RepeatDirection="Horizontal" Width="127px"> <asp:ListItem Value="Yes">Yes</asp:ListItem> <asp:ListItem Value="No">No</asp:ListItem> </asp:RadioButtonList></span><span style="font-size: 8pt; font-family: Verdana">If "Yes" which program do they use for backups? <asp:TextBox ID="backup_program" runat="server" Font-Names="Verdana" Font-Size="X-Small" Width="200px"></asp:TextBox><br /> <br /> <br /> </span> </td> </tr> <tr> <td colspan="3" style="width: 540px; height: 21px; text-align: center"> <span style="font-size: 14pt; font-family: Verdana">Mail Server Backup</span></td> </tr> <tr> <td colspan="3" style="width: 540px; height: 21px; text-align: left"> <hr /> <span style="font-size: 8pt; font-family: Verdana">Does the customer want to backup their E-Mail system?<br /> <br /> </span> <asp:RadioButtonList ID="mail_option" runat="server" Font-Names="Verdana" Font-Size="X-Small" RepeatDirection="Horizontal" Width="127px"> <asp:ListItem Value="Yes">Yes</asp:ListItem> <asp:ListItem Value="No">No</asp:ListItem> </asp:RadioButtonList><span style="font-size: 8pt; font-family: Verdana">If "Yes" what e-mail server software does the customer use? <asp:TextBox ID="mail_info" runat="server" Font-Italic="False" Font-Names="Verdana" Font-Overline="False" Font-Size="X-Small" Width="171px"></asp:TextBox><br /> <br /> <br /> </span> </td> </tr> <tr> <td colspan="3" style="width: 540px; height: 21px; text-align: center"> <span style="font-size: 16pt; font-family: Verdana">Database Backup</span></td> </tr> <tr> <td colspan="3" style="width: 540px; height: 30px; text-align: left"> <hr /> <span style="font-size: 8pt; font-family: Verdana">Does the customer have a SQL, Access or other RDMS that they wish to have backed up?<br /> <br /> </span> <asp:RadioButtonList ID="db_option" runat="server" Font-Names="Verdana" Font-Size="X-Small" RepeatDirection="Horizontal" Width="128px"> <asp:ListItem Value="Yes">Yes</asp:ListItem> <asp:ListItem Value="No">No</asp:ListItem> </asp:RadioButtonList><span style="font-size: 8pt; font-family: Verdana">If "Yes" please list the databases the customers needs to have backed up.<br /> <asp:TextBox ID="db_info" runat="server" Height="102px" Width="321px"></asp:TextBox><br /> <br /> <br /> </span> </td> </tr> <tr> <td colspan="3" style="width: 540px; height: 21px; text-align: center"> <span style="font-size: 16pt; font-family: Verdana">Network Drives</span></td> </tr> <tr> <td colspan="3" style="width: 540px; height: 21px; text-align: left"> <hr /> <span style="font-size: 8pt"><span style="font-family: Verdana">Does the customer want any shared or mapped drives backed up? </span><span style="color: #ff0066"><span style="font-family: Verdana">(Important!)</span><span style="color: #000000"><span style="font-family: Verdana"> <br /> <br /> </span> <asp:RadioButtonList ID="mapped_option" runat="server" Font-Names="Verdana" Font-Size="X-Small" RepeatDirection="Horizontal" Width="126px"> <asp:ListItem Value="Yes">Yes</asp:ListItem> <asp:ListItem Value="No">No</asp:ListItem> </asp:RadioButtonList></span></span></span><span style="font-size: 8pt; font-family: Verdana">If "Yes" please list the mapped or network drive the customer wishes to backup.<br /> <asp:TextBox ID="mapped_info" runat="server" Height="101px" Width="321px"></asp:TextBox><br /> <br /> </span> </td> </tr> <tr style="color: #000000"> <td colspan="3" style="width: 540px; height: 21px; text-align: center"> <span style="font-size: 16pt; font-family: Verdana">Mobile Users</span></td> </tr> <tr style="color: #000000"> <td colspan="3" style="width: 540px; height: 21px; text-align: left"> <hr /> <span style="font-size: 8pt; font-family: Verdana">Does the customer have mobile users that they wish to have data backed up for?<br /> <br /> </span> <asp:RadioButtonList ID="RadioButtonList1" runat="server" Font-Names="Verdana" Font-Size="X-Small" RepeatDirection="Horizontal" Width="121px"> <asp:ListItem>Yes</asp:ListItem> <asp:ListItem>No</asp:ListItem> </asp:RadioButtonList><span style="font-size: 8pt; font-family: Verdana">If "Yes" please enter the username and machine name for mobile user as well as when they will be in the office for remote install of software.<br /> <asp:TextBox ID="TextBox1" runat="server" Height="101px" Width="321px"></asp:TextBox><br /> <br /> </span> </td> </tr> <tr style="color: #000000"> <td colspan="3" style="width: 540px; height: 21px; text-align: center"> <asp:Button ID="Button" runat="server" Text="Submit Form For Processing" /></td> </tr> </table> </div> </div> </form> </body> </html>
View Replies !
Inserting Data To SQL
Hi all, I'm having a problem saving the information from my web form into my sql database when I clicked on the 'Submit' button. This is the error message Server Error in '/Helpdesk' Application. ExecuteNonQuery: Connection property has not been initialized. I've attached my code below. Please advise me on what is wrong... How should I initialise the ExecuteNonQuery. ========= start code ==================== Dim MySQL As String MySQL = "" Dim MyConn As SqlConnection = New SqlConnection() Dim MyCmd As SqlCommand = New SqlCommand() MyConn.ConnectionString = "Server=ESAWEB2;Database=Helpdesk;Trusted_Connection=True;" MySQL = "INSERT INTO TBL_TROUBLE_TICKET (Priority) values (' ddlpriority ')" MyConn.Open() MyCmd.ExecuteNonQuery() MsgBox("Record Inserted") =======end code ===============
View Replies !
Inserting Xml Data
Hi,Is there any way to insert the output of xml_auto into a tablefor eg:select * from categories for xml autoi need the output of the abouve query to be inserted into another tablethe destination table has one column,
View Replies !
Inserting Data
I want to insert data into a table Period without overwriting old data SELECT Period1Start,Period1End, 1 as PeriodType, SuperAreaID,Period1Price INTO Period FROM EUBoatsPreferences2 where SuperAreaID = 71 go SELECT Period1Start,Period1End, 2 as PeriodType, SuperAreaID,Period1Price INTO Period FROM EUBoatsPreferences2 where SuperAreaID = 72 SQL 2005 IS SAYING Msg 2714, Level 16, State 6, Line 1 There is already an object named 'Period' in the database. Which I know, I just want to append the data, pls help If it is that easy, everybody will be doing it
View Replies !
Inserting Data PK/FK
I'm trying to insert a record into a master table, but b/c of the foreign key relationship, I know that I need to first insert a record into the child table so I don't get a foreign key error. The problem is that the record that I'm inserting doesn't have any columns that match up (similar)to the child table, and only a few that match up to the master table.
View Replies !
Adding Data To Db
Hi guys, this is going to sound like a ridiculous question, but when you are first adding all your records, do you need to add all the foreign key data yourself so that it ties together? eg. If studentid =1 in first table, then you need to add record for student id in bridging table so that studentid= 1:teacherid=1 and add teacher id=1 if it is not autoincrementing???? Thanks Cm
View Replies !
Inserting Data Into A SQL Db Using VB && Javascript
Greetings to all - I am trying to enter the date fields from my form into a SQL 2005 db by way of Visual Basic. The VB parameters are as follows: Protected Sub DataEntry_Btn_NewGig_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataEntry_Btn_NewData.Click Dim EnterData As New SqlDataSource() EnterData.ConnectionString = ConfigurationManager.ConnectionStrings("MyDB_ConnectionString").ToString EnterData.InsertCommandType = SqlDataSourceCommandType.Text EnterData.InsertCommand = "INSERT INTO Data(Name,ExpertiseID,Description,PONumber,StartDate,EstHours,HourlyRate)VALUES(@Name,@ExpertiseID,@Description,@PONumber,@StartDate,@EstHours,@HourlyRate)" EnterData.InsertParameters.Add("Name", TBox_Name.Text) EnterData.InsertParameters.Add("ExpertiseID", Drop_Expertise.SelectedValue) EnterData.InsertParameters.Add("Description", TBox_Description.Text) ...and so on... All works well with data input into the ASP form using VB. The problem is, I'm using a Javascript date picker (calendar) to make it easier for users to input the date into the "StartDate" SQL column mentioned above. Do I want to use Javascript to enter this data, or VB? And, how do I write this code whether it is one or the other? I want to have all data entered with one button click event. Also, the code I am using for the calendar date picker is below: <td><input type="text" name="date" id="f_date_a" readonly="readonly" /> <img src="img.gif" id="f_trigger_a" style="cursor: pointer; border: 1px solid blue;" title="Date selector" onmouseover="this.style.background='blue';" onmouseout="this.style.background=''" alt="Click to Enter Date"/> <script type="text/javascript">Calendar.setup({inputField : "f_date_a",ifFormat : "%B %e, %Y",button : "f_trigger_a",align : "TL",singleClick : true }); </script></td> I apologize if this post is in the wrong forum; thanks to all in advance...
View Replies !
INSERTING DATA WITH WEB FORM
I need help to resolve the following problem. I have a form that is supposed to insert data into my data base. But I get an error message when I click submit. Below is the Code and after that is the error message that I get. Thank you in advance. <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server">Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) End SubProtected Sub insertSubmitBtn_Click(ByVal sender As Object, ByVal e As System.EventArgs) SqlDataSource1.Insert()End Sub </script><html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Untitled Page</title> <script type="text/javascript"> function pageLoad() { } </script> <style type="text/css"> .style1 {width: 34%; } .style2 {width: 144px; }</style> </head><body> <br /> <form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <br /><asp:SqlDataSource ID="SqlDataSource1" runat="server" InsertCommand="INSERT INTO property(provinceName, cityName, ownerName, ownerPhone, numOfRooms, rent, ownerEmail, listPeriod, addInfo) VALUES(@provinceName, @cityName, @ownerName, @ownerPhone, @numOfRooms, @rent, @ownerEmail, @listPeriod, @addInfo)"> <InsertParameters><asp:ControlParameter ControlID="provinceddl2" Name="provinceName" PropertyName="SelectedValue" /><asp:ControlParameter ControlID="cityddl2" Name="cityName" PropertyName="SelectedValue" /><asp:ControlParameter ControlID="nameTxtBox" Name="ownerName" PropertyName="Text" /><asp:ControlParameter ControlID="phoneTxtBox" Name="ownerPhone" PropertyName="Text" /><asp:ControlParameter ControlID="roomsTxtBox" Name="numOfRooms" PropertyName="Text" /> <asp:ControlParameter ControlID="rentTxtBox" Name="rent" PropertyName="Text" /><asp:ControlParameter ControlID="EmailTxtBox" Name="ownerEmail" PropertyName="Text" /><asp:ControlParameter ControlID="listPeriodddl" Name="listPeriod" PropertyName="SelectedValue" /><asp:ControlParameter ControlID="addInfoTxtBox" Name="addInfo" PropertyName="Text" /> </InsertParameters> </asp:SqlDataSource> <br /> <br /> <br /> <br /> <table cellspacing="1" class="style1"> <tr> <td class="style2"> Contact Name:</td> <td> <asp:TextBox ID="nameTxtBox" runat="server" Width="200px"></asp:TextBox> </td> </tr> <tr> <td class="style2"> Contact phone:</td> <td> <asp:TextBox ID="phoneTxtBox" runat="server" Width="200px"></asp:TextBox> </td> </tr> <tr> <td class="style2"> Province:</td> <td> <asp:DropDownList ID="provinceddl2" runat="server" Width="205px"> </asp:DropDownList> </td> </tr> <tr> <td class="style2"> City:</td> <td> <asp:DropDownList ID="cityddl2" runat="server" Width="205px"> </asp:DropDownList> </td> </tr> <tr> <td class="style2"> Email:</td> <td> <asp:TextBox ID="EmailTxtBox" runat="server" Width="200px"></asp:TextBox> </td> </tr> <tr> <td class="style2"> Number of Rooms:</td> <td> <asp:TextBox ID="roomsTxtBox" runat="server" Width="80px"></asp:TextBox> </td> </tr> <tr> <td class="style2"> Monthly Rent:</td> <td> <asp:TextBox ID="rentTxtBox" runat="server" Width="80px"></asp:TextBox> </td> </tr> <tr> <td class="style2"> Period to list:</td> <td><asp:DropDownList ID="listPeriodddl" runat="server" DataSourceID="listPeriodSqlDataSource" DataTextField="listDays" DataValueField="listDays" Width="85px"> </asp:DropDownList><asp:SqlDataSource ID="listPeriodSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:PlaceConnectionString1 %>" SelectCommand="SELECT [listDays] FROM [listPeriod]"></asp:SqlDataSource> </td> </tr> <tr> <td class="style2"> Additional Infomation:</td> <td><asp:TextBox ID="addInfoTxtBox" runat="server" Rows="5" TextMode="MultiLine" Width="200px"></asp:TextBox> </td> </tr> </table> <br /> ; <asp:Button ID="insertSubmitBtn" runat="server" Text="Submit" Width="140px" onclick="insertSubmitBtn_Click" /> <br/> <cc1:CascadingDropDown ID="Provincecdd2" runat="server" TargetControlID="Provinceddl2" Category="Province" PromptText="Select a province" ServicePath="Location.asmx" ServiceMethod="GetProvince" /> <br /><cc1:CascadingDropDown ID="Citycdd2" runat="server" TargetControlID="Cityddl2" ParentControlID="Provinceddl2" Category="City" PromptText="Select a city" ServicePath="Location.asmx" ServiceMethod="GetCity" /> </div></form> </body> </html> Server Error . Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentException: Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [ArgumentException: Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.] System.Web.UI.ClientScriptManager.ValidateEvent(String uniqueId, String argument) +2132728 System.Web.UI.Control.ValidateEvent(String uniqueID, String eventArgument) +108 System.Web.UI.WebControls.DropDownList.LoadPostData(String postDataKey, NameValueCollection postCollection) +55 System.Web.UI.WebControls.DropDownList.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) +11 System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +353 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1194 Hotkwesi
View Replies !
I Can't Retrieve Data After Inserting It ?
Dears, I'm using FormView to insert and retrieve data from SQL Server Database 2000. I'm using stored procedure to insert and display data by using C#. Every time I insert the data, I can't retrive it. To retrieve all the inserted data, I have to close my website, and then reopen it again. I close the connection every time after using the stored procedures, but nothing happened. What do you think the problem is ??
View Replies !
Regarding Inserting Data From GUI To Database
Hi iam working with the form which has fields like AuditName,Industry Name,Company Name,Plant Name,Group Name,AuditStartedOn,Auditperiod upto,CreatedOn,createdby I have dropdownlists for Industry Name,Company Name,Plant Name,Group Name.Data will be filled into Industry Name,Group Name when pageloads from the database and later depending on industryname company name and depending on company name plant name ddl's wiil be filled. Later to insert this into the Audit table i had given the Stored procedure as : create procedure CreateAudit ( @AuditName nvarchar(50), @IndustryName nvarchar(50), @IndustryID int output, @CompanyName nvarchar(50), @CompanyID int output, @PlantName nvarchar(50), @PlantID int output, @GroupName nvarchar(50), @GroupID int output, @AuditStartedOn datetime, @AuditScheduledto datetime, @CreatedOn datetime, @CreatedBy int ) as begin //Here iam getting the Id of the industryname selected in the ddl from industry table into an output parameter @IndustryID select @IndustryID=Ind_Id_PK from Industry where Industry_Name=@IndustryName //Here iam getting the Id of the companyname selected in the ddl from company table into an output parameter @CompanyID select @CompanyID=Cmp_ID_PK from Company where Company_Name=@CompanyName //Here iam getting the Id of the plantname selected in the ddl from plant table into an output parameter @PlantID select @PlantID=Pl_ID_PK from Plant where Plant_Name=@PlantName //Here iam getting the Id of the Groupname selected in the ddl from Group table into an output parameter @GroupID select @GroupID=G_ID_PK from Groups where Groups_Name=@GroupName Insert into Audits(Audit_Name,Audit_Industry,Audit_Company,Audit_Plant,Audit_Group,Audit_Started_On,Audit_Scheduledto,Audit_Created_On,Audit_Created_By)values(@AuditName,@IndustryID,@CompanyID,@PlantID,@GroupID,@AuditStartedOn,@AuditScheduledto,@CreatedOn,@CreatedBy) end Later called these parameters into class file: namespace xyz{ public class clsCreateAudit {SqlConnection con = new SqlConnection(ConfigurationSettings.AppSettings["constr"]); SqlCommand cmd = new SqlCommand();SqlDataAdapter da = new SqlDataAdapter();public clsCreateAudit() { con.Open(); }public void CreateAudit(string Audit_Name, int Audit_Industry, int Audit_Company, int Audit_Plant, int Audit_Group, DateTime Audit_Started_On, DateTime Audit_Scheduledto, DateTime Audit_Created_On, string Audit_Created_By) { cmd.Connection = con;cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "CreateAudit"; SqlParameter AuditName = new SqlParameter();AuditName.ParameterName = "@AuditName";AuditName.DbType = DbType.String; AuditName.Value = Audit_Name;AuditName.Direction = ParameterDirection.Input; cmd.Parameters.Add(AuditName); SqlParameter AuditIndustry = new SqlParameter();AuditIndustry.ParameterName = "@IndustryName";AuditIndustry.Direction = ParameterDirection.Input; AuditIndustry.Value = Audit_Industry;AuditIndustry.DbType = DbType.String; cmd.Parameters.Add(AuditIndustry); SqlParameter IndustryID = new SqlParameter();IndustryID.ParameterName = "@IndustryID"; IndustryID.Direction = ParameterDirection.Output;IndustryID.DbType = DbType.Int32; //IndustryID.Size = 100; cmd.Parameters.Add(IndustryID);SqlParameter AuditCompany = new SqlParameter(); AuditCompany.ParameterName = "@CompanyName";AuditCompany.Direction = ParameterDirection.Input; AuditCompany.Value = Audit_Company;AuditCompany.DbType = DbType.String; cmd.Parameters.Add(AuditCompany);SqlParameter CompanyID = new SqlParameter(); CompanyID.ParameterName = "@CompanyID";CompanyID.Direction = ParameterDirection.Output; CompanyID.DbType = DbType.Int32; //IndustryID.Size = 100; cmd.Parameters.Add(CompanyID); SqlParameter AuditPlant = new SqlParameter(); AuditPlant.ParameterName = "@PlantName";AuditPlant.Direction = ParameterDirection.Input; AuditPlant.Value = Audit_Plant;AuditPlant.DbType = DbType.String; cmd.Parameters.Add(AuditPlant);SqlParameter PlantID = new SqlParameter(); PlantID.ParameterName = "@PlantID";PlantID.Direction = ParameterDirection.Output; PlantID.DbType = DbType.Int32; //IndustryID.Size = 100; cmd.Parameters.Add(PlantID);SqlParameter AuditGroup = new SqlParameter(); AuditGroup.ParameterName = "@GroupName";AuditGroup.Direction = ParameterDirection.Input; AuditGroup.Value = Audit_Group;AuditGroup.DbType = DbType.String; cmd.Parameters.Add(AuditGroup);SqlParameter GroupID = new SqlParameter(); GroupID.ParameterName = "@GroupID";GroupID.Direction = ParameterDirection.Output; GroupID.DbType = DbType.Int32; //IndustryID.Size = 100; cmd.Parameters.Add(GroupID);SqlParameter AuditStartedOn = new SqlParameter(); AuditStartedOn.ParameterName = "@AuditStartedOn";AuditStartedOn.Direction = ParameterDirection.Input; AuditStartedOn.Value = Audit_Started_On;AuditStartedOn.DbType = DbType.String; cmd.Parameters.Add(AuditStartedOn);SqlParameter AuditScheduledto = new SqlParameter(); AuditScheduledto.ParameterName = "@AuditScheduledto";AuditScheduledto.Direction = ParameterDirection.Input; AuditScheduledto.Value = Audit_Scheduledto;AuditScheduledto.DbType = DbType.String; cmd.Parameters.Add(AuditScheduledto);SqlParameter CreatedOn = new SqlParameter(); CreatedOn.ParameterName = "@CreatedOn";CreatedOn.Direction = ParameterDirection.Input; CreatedOn.Value = Audit_Created_On;CreatedOn.DbType = DbType.String; cmd.Parameters.Add(CreatedOn);SqlParameter CreatedBy = new SqlParameter(); CreatedBy.ParameterName = "@CreatedBy";CreatedBy.Direction = ParameterDirection.Input; CreatedBy.Value = Audit_Created_By;CreatedBy.DbType = DbType.Int32; cmd.Parameters.Add(CreatedBy); cmd.ExecuteNonQuery(); con.Close(); } } } Then i called these function into .aspx.cs file: using xyz;protected void btn_CreateAudit_Click(object sender, EventArgs e) {SqlConnection con = new SqlConnection(ConfigurationSettings.AppSettings["constr"]); PCRA.clsCreateAudit obj = new PCRA.clsCreateAudit(); SqlCommand cmd = new SqlCommand(); //Iam getting the Session(UID) from my login page.obj.CreateAudit(txt_AuditName.Text, Convert.ToInt32(ddl_Industry.SelectedItem.Value), Convert.ToInt32(ddl_Company.SelectedItem.Value), Convert.ToInt32(ddl_Plant.SelectedItem.Value), Convert.ToInt32(ddl_Group.SelectedItem.Value), Convert.ToDateTime(txt_StartingOn.Text.ToString()), Convert.ToDateTime(txt_AuditPeriod.Text.ToString()), System.DateTime.Now, Session["UID"].ToString());lbl_Mesg.Text = "Your Audit Details are added succesfully"; } But iam getting an error here near obj.CreateAudit as: Input string was not in a correct format. I even want to know if my storedprocedure reaches the requirement which i specified. please help me with this.Its very urgent.
View Replies !
Inserting Data Into Ms SQL Server
I am trying to transition from Access to MS SQL. I downloaded and installed MS SQL 2005 Express and the Server Management Studio Express. Keep in mind that I am a total newbie to this database since I've always used Access. My question is, how do I insert data manually into my tables? I figured out how to set up a table and query a table, but is there somewhere I can just plug in data? In Access, I just open the table and type it in. Also, how do you set an auto increment numeric field in a table?- Jason
View Replies !
Inserting Unicode Data
Hi. We have a sql server db that we need to store Unicode text in. The fields are of the type nvarchar, ntext and nchar. Our solution uses both Oracle and SqlServer as a backing database. In Oracle there is a connection string switch "Unicode=True" that fixes the problem. Is there something similar in SqlServer? Since the db layer is generic we'ed like to avoid using a N' prefix on text strings in query statements.
View Replies !
Inserting Data From TextBox
Hi, I'm a newbie to to asp.net. I have been trying to get this done but have no idea how to go about to do it. I am using Visual Studio Express 2005 and SQL Server Express 2005. I have a database "RECORDS" and a table "NAME" with columns "NAMEID - int" and "NAMERECORDS - varchar(50)" I opened new website asp.net using vb. In the default I have one textbox (textbox1) and button (button1). I wish to insert a new NAME to the database whenever I click the Button1. I have created the INSERT command but unsure how to code it. I appreciate anyone can show me how to insert to the database whatever is being typed in the textbox whenever I click the button1. Thanks in advance.
View Replies !
Inserting Duplicate Data
This is probably a silly question to most of you, but I'm in the processof splitting off years from a large DB to several smaller ones. Some ofthe existing smaller DBs already have most of the data for theirrespective years. But some of the same data is also on the source DB.If I simply do an insert keying on the year column, and a row beinginserted from the source DB already exists in the target DB, will aduplicate row be created?And if so, how can I avoid that?Thanks,John Steen*** Sent via Developersdex http://www.developersdex.com ***Don't just participate in USENET...get rewarded for it!
View Replies !
Inserting Different Case Data
Currently am migrating my data from oracle to sqlserver. Here is a senario where am struck. CREATE TABLE TEST (COL1 VARCHAR(90), CONSTRAINT TEST_PK PRIMARY KEY (COL1) ); INSERT INTO TEST VALUES ('test'); INSERT INTO TEST VALUES ('TEST'); -- UPPER CASE data The above is acceptable in oracle but in sqlserver in case insesitive database the second value is not accepted as it voilates the PK constraint. I searched the forums and found below link http://www.dbforums.com/t905653.html But on doing it resulted in below error: Server: Msg 5074, Level 16, State 8, Line 1 The object 'TEST_PK' is dependent on column 'COL1'. Server: Msg 4922, Level 16, State 1, Line 1 ALTER TABLE ALTER COLUMN COL1 failed because one or more objects access this column.
View Replies !
Struggling With Inserting Data
Hello all I am trying to insert data from the Report table to the Revised_Maintable my problem is that I get an error message every time. I dont know what to do INSERT INTO dbo.Revised_MainTable([IR Number], Date, [I/RDocument], [Violation Type] ) SELECT [Date], [I/RDocument], TypeOfIncident, [Incident Report No] FROM dbo.Report WHERE NOT EXISTS(SELECT * FROM dbo.Report WHERE [Incident Report No] = [IR Number]) This is the Report Table [dbo].[Report]( [Incident Report No] [nvarchar](100) NOT NULL, [Date] [datetime] NULL, [Time] [datetime] NULL, [Investigators Name] [nvarchar](100) NULL, [Reported by] [nvarchar](100) NULL, [Law Enforcement Agency] [nvarchar](100) NULL, [Name of Officer] [nvarchar](100) NULL, [Evidence Seized] [nvarchar](100) NULL, [Associated Reports] [nvarchar](50) NULL, [Corrective Action] [nvarchar](50) NULL CONSTRAINT [DF_Report_Corrective Action] DEFAULT (N'YES'), [Comments] [ntext] NULL, [I/RDocument] [ntext] NULL CONSTRAINT [DF_Report_I/RDocument] DEFAULT (N'SCANNED REPORT'), [TypeOfIncident] [nvarchar](300) NULL, [Exclusion] [nvarchar](50) NULL CONSTRAINT [DF_Report_Exclusion] DEFAULT (N'NO'), [86_D] [nvarchar](50) NULL CONSTRAINT [DF_Report_86_D] DEFAULT (N'NO'), [Loss] [money] NULL CONSTRAINT [DF_Report_Loss] DEFAULT (0.0000), [LossType] [nvarchar](50) NULL, [Area] [nvarchar](75) NULL, [Action/Incident] [nvarchar](50) NULL, [Security/GC] [nvarchar](50) NULL CONSTRAINT [DF_Report_Security/GC] DEFAULT (N'GC'), CONSTRAINT [PK_Report] PRIMARY KEY CLUSTERED ( and the Revised_MainTable [dbo].[Revised_MainTable]( [I/RDocument] [ntext] NULL CONSTRAINT [DF_Revised_MainTable_I/RDocument] DEFAULT (N'Scanned Report'), [IR Number] [nvarchar](100) NOT NULL, [Date] [datetime] NULL, [Inspector] [nvarchar](50) NULL, [Area] [nvarchar](50) NULL, [Violation] [nvarchar](50) NULL, [Violation Type] [nvarchar](100) NULL, [Loss] [money] NULL CONSTRAINT [DF_Revised_MainTable_Loss] DEFAULT (0.0000), [Loss Type] [nvarchar](50) NULL, [Employee] [ntext] NULL, [Guest] [ntext] NULL, [Action] [nvarchar](50) NULL, [Action Type] [nvarchar](50) NULL, [Notes] [ntext] NULL, [Security/GC] [nvarchar](50) NULL CONSTRAINT [DF_Revised_MainTable_Security/GC] DEFAULT (N'GC'), CONSTRAINT [PK_Revised_MainTable] PRIMARY KEY CLUSTERED (
View Replies !
Inserting A Tabular Data
Need some suggestions on how to insert a tabular data in a table. we have a deal table and lets say a particular deal has 10 rows (and 25 columns). user makes some changes to one of the 10 rows, while saving all the 10 rows have to be inserted with a new version id. so everytime a new version is to be created, all 10 rows should be added to the table in one transaction. whats a good way to do that...xml is one option...what else?
View Replies !
Sql 6.5 Error 605 When Inserting Data
i get error 605 on several occassions... namely when i am doing a bcp into the database OR when a user is trying to update a record. it seems very sparodic otherwise, but it always happens during the bcp insert. if anyone has any ideas or suggestions on how to correct this issue, it would be greatly appreciated. need additional info?
View Replies !
Inserting Data From One Table To Another
Hi, I have two tables in a data base and i'm inserting the data from one into the other...no probs. What i was wondering is, in table1 i have an column of ID numbers. In the table2 i have a matching set of ID numbers. There are 5 PersonID numbers in table one and 10 in table two, the same 5 numbers as in table1 but each ID has a duplicate with different data in the two rows. SAMPLE: INSERT INTO Table1 (PersonID, level1, Level2, Level3, Level4) SELECT PersonID,level1, Level2, Level3, Level4 FROM Table2 When i insert the data into table1 it leaves the first 5 rows of data as null and then populates the table with all the data from table two. Is there anyway of preventing these first 5 columns from remaining empty.... I hope that makes sense
View Replies !
Inserting GUID Data
Hi everybody I have a table named GrpMembership which has columns ParticipantId and InterestGroupId that have datatypes uniqueidentifier.When I try to run the following insert stmt: insert into grpmembership (guparticipantid,guInterestGroupId,bIsAdmin,dtCrea ted) values ({EE0BC83E-01DD-4B0D-BFAA-34B508C28CF3} {D149BD88-55B6-4EB9-AA81-1E1B5141EFA6}, 0,6/7/2002) it gives error: [Microsoft][ODBC SQL Server Driver]Syntax error or access violation Please Help Regards Jignesh
View Replies !
Inserting Data Into SQL Server
declare @counter int select @counter=300000 while @counter > 0 begin insert into Revenue (Instr_type, Tel_no, Phone_Id, Rpt_date, Pay_mode) values("PP0073", @counter, "080464", "19990901", 1) select @counter=@counter-1 end HI there, I run the above statement in Query Analyzer and the expected result should be 300,000 records inserted into Revenue table. But unfortunately the actual records inserted were less than 300,000. I also realise that it insert different amount of record each time I run it. Can anyone please tell me why? Thanks, Will
View Replies !
Inserting Data Into SQL Server
Hi, Everybody: Could anyboby please tell me any way which can quickly inserting large data to SQL Server except using cursor? Every morning, I use DTS to transfer around 100,000 data from foxpro to SQL Server 7.0 temporary table. Then I use cursor to check if the data already exist in the SQL Server table, then I do update; if the data does not exist in the SQL Server table, then I do insert into. In SQL Server database, each table already has over million record, also I have 12 table with the same situation. Now I find cursor very slow to do above, can anybody tell me any way which can quickly to do update and insert? Thank you very much.
View Replies !
INSERTING DATA INTO SQL DATABASE
I have table in my SQL db I am inserting value using insert statement Following are statement which I am using when inserting data into database INSERT INTO EMPLOYEE (NAME, TELEPHONE, PINNUM,CELLNUM) SELECT NAME,TELEPHONE,PINNUM FROM EMPLOYEE WHERE EMPLOYEEID=1 Noticed that I dont have CELLNUM In my select statment, but I want to insert that number from textbox which I have on my webform. can some one tell me how do i do this query so i can insert data into database. HELP ME thank u maxs
View Replies !
Ole Db Destination Not Inserting Data
my package has a data flow task that is attempting to insert data into a sql server table using the ole db destination. the package validates and runs without reporting any errors, but the data was not inserted into the table. my data mappings look fine. how can i see what's happening when the component attempts to insert the data into the table?
View Replies !
Inserting Data For Testing
This is the code I'm using to insert data into a table with data from one table, but changing a single column to prevent duplicates and to increase the number of rows. I know I'm missing something easy, but... what is it? thx, Kat code to create the table: CREATE TABLE [OrdDetails] ( [OrderID] [int] NOT NULL , [ProductID] [int] NOT NULL , [UnitPrice] [money] NOT NULL , [Quantity] [smallint] NOT NULL , [Discount] [real] NOT NULL , CONSTRAINT [PK_OrdDetails] PRIMARY KEY CLUSTERED ( [OrderID], [ProductID] ) ON [PRIMARY] ) ON [PRIMARY] GO I inserted all the data from the [Order Details] table, now I'm trying to reinsert the data but changing the PK constraint to prevent error. Seems like this should work. truncate table OrdDetails insert into OrdDetails select * from [Order Details] /*note, table has 2155 rows to start*/ Declare @CTR INT, @CTR2 INT SELECT @CTR = 0 SELECT @CTR2 = 0 WHILE @CTR < 3000 and @CTR2 < 3000 BEGIN SELECT @CTR = @CTR + 1 SELECT @CTR2 = @CTR2 + 1 INSERT ORDDETAILS SELECT @CTR, (ProductID + @CTR2) , UnitPrice, Quantity, Discount FROM [Order Details] END I still get primary key errors about not being able to insert dups, this is probably easy, but I'm missing something, help! kat
View Replies !
Inserting Dummy Data
No one answered this question, how do people normally insert dummy data into tables? I mean, where does the data typically come from? what process is used to insert the data? Note: This is for testing purposes, eventually to be tested in a Web-based front-end which I know nothing about. thx, Kat
View Replies !
Inserting Data Into Another Table
Hi, I'm fairly new to SQL Server 2005. i have a table that creates customer id's along with other data (let's call it Customer) I would like to take the same customer_id data and import it into a different table (HQ_Customer) the new table also has different column names. Is there a script that can be used for this problem?
View Replies !
Inserting Data From One Table To Another
Well, I think this should be an easy question, but here goes: I'm taking data from one table and inserting it into another. According to the SQL Server Mobile Book Online, the syntax goes like this: INSERT INTO Table1 (col1, col2) SELECT (col1, col2) from Table2 So while I can do this with my tables: INSERT INTO sensor_stream (sensor_stream_id) SELECT (sensor_stream_id) FROM sensor_stream_temp If I add any more columns, I get an error. Like this: INSERT INTO sensor_stream (sensor_stream_id, sensor_stream_type_id) SELECT (sensor_stream_id, sensor_stream_type_id) FROM sensor_stream_temp The error is "There was an error parsing th equery. [ Token line number =1, Token line offset = 98, Token in error = ',' ]" Anyone have any ideas about why I cannot do more than one column at a time? TIA, -Dana
View Replies !
Adding Data To More Than One Table
Hi there,I am currently setting up a registration system where customers can registers their details and the details of the product, using ASP.net and MS SQL.There is a column called customerID in the Custoemrs table, and a column of the same name in the Products table, so that I can have relationships between the tables.For obvious reasons (ie. people that quit half-way through), I want to hold all the information until the end. The ID in the Customer table is unique, and auto-increasing, and therefore not assigned until the data enters the database.However, I wish to submit information to the Products table at the same time, but what shall I put in for the custoemrID (which hasn't yet been assigned)Thank you in advance for your help,Nathair
View Replies !
Adding Data Into A Database
I'm new at this and wondering if someone would have the heart to help.I want to know how to add data into a database. Here's the details:I have a sqldatasource( sqldatasource1) attached to a database with a table named customers.The table(customers) has one field named 'Name' with datatype varchar(50)I have a textbox (textbox1) and a button (button1)I want to insert the text into textbox1 into my database. how can i do that?
View Replies !
Adding Data Through Views ?
Hi! Is it possible to add/delete/modidy data through views? What is the major difference between SQL Stored procedure & SQL function?One diff i know is using SP we can execute transact-sql statements.Is there any other difference? Thanks in advance
View Replies !
Adding SDF Data Into A Listview - C#
Hello everyone, I finally got the SDF file on my pocket pc, and now am having trouble loading the data into the listview. I am not sure where I am going wrong, but the code is listed below. Any ideas? Thanks so much, everyone. private void LoadList(string szSQL) { // Clear out anything that might already be in the list CollectionList.Items.Clear(); // save off the SQL Statement m_szCurrFilter = szSQL; // Throw Data into the list SqlCeCommand sqlLoadEvents = m_cConn.CreateCommand(); sqlLoadEvents.CommandText = szSQL; SqlCeDataReader rReader = sqlLoadEvents.ExecuteReader(); // roll through the reader and put items into the list while ( rReader.Read() ) { ListViewItem lvItem = new ListViewItem(rReader.GetValue(rReader.GetOrdinal("ca_id")).ToString()); //Nmbr // Note: Since a "tag" is not supported by the compact framework, we'll use the "ImageIndex" // property to hold the movie ID, this way we can find it later when the user clicks // on an item lvItem.ImageIndex = (int)rReader.GetValue(rReader.GetOrdinal("ca_id")); lvItem.SubItems.Add(rReader.IsDBNull(rReader.GetOrdinal("ca_titel")) ? "" : rReader.GetValue(rReader.GetOrdinal("ca_titel")).ToString()); // Title lvItem.SubItems.Add(rReader.IsDBNull(rReader.GetOrdinal("ca_alter")) ? "" : rReader.GetValue(rReader.GetOrdinal("ca_alter")).ToString()); // Rating lvItem.SubItems.Add(rReader.IsDBNull(rReader.GetOrdinal("ca_sex")) ? "" : rReader.GetValue(rReader.GetOrdinal("ca_sex")).ToString());// Gender CollectionList.Items.Add( lvItem ); } }
View Replies !
Adding Data To Columns
Hi I'm am using SQL Server 2005 Express on my home PC. To practice some of the SQL skills I learned on a course I was recently on, I am trying to build a mini database which I can run some queries from. I have created some tables and added columns to these tables. However, I cannot find how to add data to these columns. I'm sure it's pretty simple but I just can't find it! Can anyone help?? Cheers!
View Replies !
Adding Data To A String
Hi, I'm not a programmer by trade, so please be gentle with me! I am trying to add or insert data to the beginning of an existing string of data. The string is in one field in a table, with various options seperated by [ ]. An example of the current data is: [Eye Color:TEST][Hair Color:TEST] and I would like to add the data [# Persons:1] to the beginning of the string so it looks like this: [# Persons:1][Eye Color:TEST][Hair Color:TEST] Can anyone help me with the best way to do this?
View Replies !
Inserting Data To Table From Textbox
Hello all.... I am trying to submit data from a form(textbox) to a sql table. but I am getting an error message "NullReferenceException was unhandled by user code" Can any help me with this? This is my code inProtected Sub btnSubmit_ServerClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click Dim cnstr As String = ConfigurationManager.ConnectionStrings("ConnectionString").ToString()Dim pa1 As Data.SqlClient.SqlParameter = New Data.SqlClient.SqlParameter("Keyword", Data.SqlDbType.VarChar, 50, Data.ParameterDirection.Input) pa1.Value = Keyword.Text SqlHelper.ExecuteNonQuery(cnstr, Data.CommandType.StoredProcedure, "spNewRec", pa1) Thanks in advance...
View Replies !
Inserting Data From A DB Into A Text Field
Hello Everyone, I have looked and looked for any information on how to insert data from a db into a text field using a stored procedure. If anyone has any helpful links or suggestions, my sanity would greatly appreciate the help. Thank you
View Replies !
Error Inserting Data In ASPNETDB.net
I created my own table on the ASPNETDB.mdf file. When i try to insert data on it, i get an exception: System.Data.SqlClient.SqlException was unhandled by user code Message="String or binary data would be truncated. The statement has been terminated." Source=".Net SqlClient Data Provider" ErrorCode=-2146232060 Class=16 LineNumber=1 Number=8152 Procedure="" Server="\\.\pipe\33189AFE-4730-4B\tsql\query".... My C# code to insert:SqlConnection conexao = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["LocalSqlServer"].ConnectionString); string query = "Insert Into NovasMaquinas " +"(NomeDaMaquina, FicheiroExecutavel, FicheiroXML, AdminQueSubmeteu, Autor, VmID)" + "Values (@NomeDaMaquina, @FicheiroExecutavel, @FicheiroXML, @AdminQueSubmeteu, @Autor, @VmID)";SqlCommand cmd = new SqlCommand(query, conexao); cmd.Parameters.AddWithValue("@NomeDaMaquina", textboxNomeVM.Text);cmd.Parameters.AddWithValue("@FicheiroExecutavel", path + fileUploadEXE.PostedFile.FileName); cmd.Parameters.AddWithValue("@FicheiroXML", path + fileUploadEXE.PostedFile.FileName);cmd.Parameters.AddWithValue("@AdminQueSubmeteu", User.Identity.Name); cmd.Parameters.AddWithValue("@Autor", textboxAutorVM.Text);cmd.Parameters.AddWithValue("@VmID", Guid.NewGuid().ToString()); conexao.Open(); //cmd.CommandType = CommandType.Text; cmd.ExecuteNonQuery(); //THAT IS THE LINE WHERE THE EXCEPTION IS THROWN conexao.Close(); Any ideas wath i'm doing wrong?
View Replies !
Errors Encountered When Inserting Data
I had been frequently encountering these errors when I run my page: "Error converting data type nvarchar to int.Cannot insert the value NULL into column 'COMPANY_CODE', table 'ZSWAREHOUSE.dbo.ZS_COMPANY_TBL'; column does not allow nulls. INSERT fails.The statement has been terminated.". How do I solve this, so that I can insert data in my company table?
View Replies !
Problem In Inserting Data To SQL Server
Hi, Just look at my Code:protected void Button1_Click(object sender, EventArgs e) {SqlConnection Conn = new SqlConnection("MyConnectionString"); SqlCommand Cmd = new SqlCommand();string linktext,headline, quote, para1, para2, para3; linktext = this.TextBox1.Text;headline = this.TextBox1.Text; quote = this.TextBox2.Text;para1 = this.TextBox3.Text; para2 = this.TextBox4.Text;para3 = this.TextBox5.Text;Cmd.CommandText = "insert into desieyenews(linktext,newsheadline,quote,para1,para2,para3) values ("+linktext+","+headline+","+quote+","+para1+","+para2+","+para3+")"; Cmd.Connection = Conn; Conn.Open(); Cmd.ExecuteNonQuery(); Conn.Close(); } Details: In the above code I am inserting data from 5 textbox to my databse. It works fine but when I am trying to insert text like Tom's..., problem occurs. Whenever I am trying to insert some text with a single quote, the problem arises. Although the datatype of my database is text in MS SQL Server 2005. Please give me some solution so that I can get rid of this problem.... Thanks in advance. Tapas
View Replies !
|