Very basic question here but I need to add a form to a page so it adds content, its as simple as that. I've done this kind of using a <asp.Formview> tag and it works, but becuase I think I've used a form view I have to click add to insert data first. Should I be using the <asp:formview> tag or is it a problem with the templates?
<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" CommandName="New"
Text="Click here to Add New Content">
</asp:LinkButton>
</ItemTemplate>
Hello. As the subject heading says, I'm not able to insert data typed into the contact form on my page into a database table. I'm using an SqlDataSource object. Here's the code for this page:
Hey all, I have a form in one page and when the user clicks the submit button it has to save the data into my SQL database which i have created.It doesnt show any error and it successfully redirects to another page but not saving the data .Could someone help please.Here is my code under submit button SqlDataSource txtDataSource = new SqlDataSource(); txtDataSource.ConnectionString = ConfigurationManager.ConnectionStrings["LocalSqlServer"].ToString(); txtDataSource.InsertCommandType = SqlDataSourceCommandType.Text; txtDataSource.InsertCommand = "INSERT INTO Hamburgdata(user_name, report_type, company_name , street_address, city, state, zip_code, tax_ID) VALUES (@user_name,@report_type,@company_name ,@street_address,@city,@state,@zip_code,@Tax_ID)"; txtDataSource.InsertParameters.Add("user_name", User.Identity.Name); txtDataSource.InsertParameters.Add("report_type", ReportType.Text); txtDataSource.InsertParameters.Add("company_name", CompanyName.Text); txtDataSource.InsertParameters.Add("street_address", StreetAddress.Text); txtDataSource.InsertParameters.Add("city", City.Text); txtDataSource.InsertParameters.Add("state", State.Text); txtDataSource.InsertParameters.Add("zip_code", ZipCode.Text); txtDataSource.InsertParameters.Add("tax_ID", TaxID.Text); int rowAffected = 0; try { rowAffected = txtDataSource.Insert(); } catch (Exception exp) { } finally { txtDataSource = null; } } ThanksVik
Hi I am trying to develop a web based application. I am trying to insert data from my web form into sql server database using stored procedures. I am having a problem while i try to exceute the command. The error given by system is System.InvalidCastException: Object must implement IConvertible. at System.Data.SqlClient.SqlCommand.ExecuteNonQueryany suggestion what am i missing?With Regards,Sameer Jindal
Hi friends, I,m familiar with accessing data from a SQL DB using ASP. Lets say I have a cinema website with lots of info about upcoming shows, well, how do I export data form the database to a third party?? Lets say a local newspaper wants the show-time info. How do I get the data to them. Also how are different files .xls etc,exported? Thanks for any help. Meltdown ///// ~ ~ @ @ < \__/
In my current project we are dealing with a lot if Infopath forms of all sizes and complexities. currently they are being saved in Forms library of sharepoint. We need to build a warehouse for SSRS which receives data either from content database or from infopath forms submit with minimum latency. I thought of few alternatives, but, not sure which is most robust and economical. 1. Built c# classes to parse XML of infopath forms and then push data to SQL using ADO.net and SQL stored procedure while item is being added (ItemAdding) to Forms Library. 2. Use CAML queries to extract XML from forms library and then continue with C#/ADO/SQL.. 3. Use SSIS APIs and webservices to massage XML and put it to SQL at ItemAdding event 4. Use CAML queries to generate XML files and stage it to FTP and rest will be done on SSIS.
I am currently looking for feseability information based of Besy Known Practise. Please feel free to suggest a totally new approach, if available.
I'd created a dataform from a table stored in a SQL database, after that I changed the primary key field to be an identity, refreshed the dataset but when I execute the program, it raises an exception when I try to save the record after adding a new one asking me for the value of this field. What can I do to be sure it will be created automatically?
Hi, I am designing a site using Visual Web Developer, CSharp and Sql server Express. One the contact page I want to put a form that allows users to enter details about themselves. On clicking the button this will be stored in the database under a table called subscribers. The form will have, name, address, telephone, email fields etc. With the email addresses from the visitors I want to be able to keep them in a newsletter section or similar which is automated so they recevie emails from time to time Could somebody suggest a tutorial which shows how to complete this process using c sharp and sql.
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: BC30456: 'InserParameters' is not a member of 'System.Web.UI.WebControls.SqlDataSource'.Source Error:
Line 15: registrationDataSource.InsertCommand = "INSERT TO Reputation (firstname, lastname)VALUES(@First Name, @Last Name)" Line 16: Line 17: registrationDataSource.InserParameters.Add("firstname", firstname.txt) Line 18: registrationDataSource.InserParameters.Add("lastname", lastname.txt) Line 19: Source File: C:UsersQaiphyx eputationDefault.aspx.vb Line: 17 Show Detailed Compiler Output:
I have a form setup, the code of which is listed below, and I would like to be able to submit the data that is entered in the form to a SQL 2005 standard database via the SqlDataSource control and a button. I'm just having trouble doing so because of the coding. Any help or suggestions would be greata s I've already read through the tutorials on this site and they don't go in depth very much. Thanks! <%@ Page Language="VB" %> <%@ Register Assembly="BasicFrame.WebControls.BasicDatePicker" Namespace="BasicFrame.WebControls" TagPrefix="BDP" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <%@ import Namespace="System.Data" %> <%@ import Namespace="System.Data.SqlClient" %> <Script runat="server"> Private Sub InsertData(ByVal Source As Object, ByVal e As EventArgs) SqlDataSource1.Insert() End Sub </Script>
<html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Weston E-Vault - New Customer Sign-Up Form</title> </head> <body> <form id="form1" runat="server"> <div style="text-align: center"> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="Data Source=C26819_24561;Initial Catalog=ebackups;Integrated Security=True;User Instance=False" ProviderName="System.Data.SqlClient" InsertCommand="INSERT INTO backup_info(cust_name, cust_phone, cust_contact, cust_analyst, storage_plan, install_date, backup_data, backupexec_option, backup_program, cust_email) VALUES (@cust_name, @cust_phone, @cust_contact, @cust_analyst, @storage_plan, @install_date, @backup_data, @backupexec_option, @backup_program, @cust_email)"> <InsertParameters> <asp:ControlParameter ControlID="DropDownList1" DefaultValue="" Name="@cust_name" PropertyName="SelectedValue" /> <asp:ControlParameter ControlID="TextBox1" Name="@cust_contact" PropertyName="Text" /> <asp:ControlParameter ControlID="TextBox2" Name="@cust_phone" PropertyName="Text" /> <asp:ControlParameter ControlID="DropDownList3" Name="@cust_analyst" PropertyName="SelectedValue" /> <asp:ControlParameter ControlID="BDPLite1" Name="@install_date" PropertyName="Controls" /> <asp:ControlParameter ControlID="TextBox3" Name="@cust_username" PropertyName="Text" /> <asp:ControlParameter ControlID="TextBox4" Name="@cust_password" PropertyName="Text" /> <asp:ControlParameter ControlID="DropDownList2" Name="@storage_plan" PropertyName="SelectedValue" /> <asp:ControlParameter ControlID="TextBox5" Name="@backup_data" PropertyName="Text" /> <asp:ControlParameter ControlID="RadioButtonList1" Name="@backupexec_option" PropertyName="SelectedValue" /> <asp:ControlParameter ControlID="TextBox6" Name="@backup_program" PropertyName="Text" /> <asp:ControlParameter ControlID="TextBox7" Name="@cust_email" PropertyName="Text" /> </InsertParameters> </asp:SqlDataSource> <br /> <br /> <br /> <table> <tr> <td style="width: 100px"> <img src="/images/westonevault_logo.jpg" /></td> <td style="width: 703px; text-align: right"> <asp:Button ID="Button1" runat="server" BackColor="White" BorderColor="Navy" BorderStyle="Solid" BorderWidth="1px" Font-Names="verdana" Font-Size="Small" ForeColor="Navy" PostBackUrl="~/secure/tech_home.aspx" Text="Back" /><span style="font-size: 8pt; color: #000099"> </span></td> </tr> </table> <br /> <br /> <img src="/images/div.jpg" style="font-size: 8pt; color: #000099" /><br /> <br /> <div style="text-align: center"> <table style="font-size: 8pt; width: 730px; color: #000099; font-family: Verdana"> <tr> <td colspan="3" style="font-weight: bold; font-family: Verdana; text-align: left"> <span style="color: #000099">Customer Information<br /> </span> <hr style="color: #000099" /> <span style="font-weight: normal; font-size: 8pt; color: #000099">Please enter all customer data as accurately as possible. Any incorrect information on this form may result in incorrect data being backed up, reports not reaching the customer or they may<span style="font-size: 12pt"><strong> </strong><span style="font-size: 8pt">not receive the need</span></span>ed amount of disk space.<br /> <br /> </span> </td> </tr> <tr style="font-size: 8pt"> <td style="width: 174px; text-align: left"> <span style="font-family: Verdana"><span style="color: navy">Customer Name:<br /> </span> <asp:DropDownList ID="DropDownList1" runat="server" DataValueField="cust_name" Font-Names="Verdana" Font-Size="X-Small" ForeColor="Navy" Width="178px"> <asp:ListItem Selected="True">Select Customer Name.....</asp:ListItem> <asp:ListItem>Alaska Road Boring</asp:ListItem> <asp:ListItem>Allen and Peterson</asp:ListItem> <asp:ListItem>AK Guns</asp:ListItem> <asp:ListItem>ATS Alaska</asp:ListItem> <asp:ListItem>BC Contractors</asp:ListItem> <asp:ListItem>Bek of Alaska</asp:ListItem> <asp:ListItem>Brokentop Community Assoc.</asp:ListItem> <asp:ListItem>COHRA</asp:ListItem> <asp:ListItem>Crisis Pregnancy Center</asp:ListItem> <asp:ListItem>Gaines and Co.</asp:ListItem> <asp:ListItem Value="Gil Damond">Gil Damond</asp:ListItem> <asp:ListItem>GMW Fire</asp:ListItem> <asp:ListItem>Integrity Funding</asp:ListItem> <asp:ListItem>La Pine Community Clinic</asp:ListItem> <asp:ListItem>La Pine Fire District</asp:ListItem> <asp:ListItem>Lumbermens Ins.</asp:ListItem> <asp:ListItem>Murray</asp:ListItem> <asp:ListItem>NEI</asp:ListItem> <asp:ListItem>Northstar Center</asp:ListItem> <asp:ListItem>Redi Electric</asp:ListItem> <asp:ListItem>Robberson Ford</asp:ListItem> <asp:ListItem>South Anchorage District Office</asp:ListItem> <asp:ListItem>St. George Tanaq</asp:ListItem> <asp:ListItem>Stinebaugh</asp:ListItem> <asp:ListItem>THT Electric</asp:ListItem> <asp:ListItem>Watterson</asp:ListItem> <asp:ListItem>United Auto</asp:ListItem> <asp:ListItem>Weston - ANC</asp:ListItem> <asp:ListItem>Weston - BND</asp:ListItem> <asp:ListItem></asp:ListItem> </asp:DropDownList><br /> </span> </td> <td style="width: 187px; text-align: left"> <span style="font-family: Verdana"><span style="color: #000099">Customer Contact:<br /> </span> <asp:TextBox ID="TextBox1" runat="server" Font-Names="Verdana" Font-Size="X-Small" Width="164px"></asp:TextBox><br /> </span> </td> <td style="width: 136px; text-align: left"> <span style="font-family: Verdana"><span style="color: #000099">Customer Phone:<br /> </span> <asp:TextBox ID="TextBox2" runat="server" Font-Names="verdana" Font-Size="X-Small"></asp:TextBox><br /> </span> </td> </tr> <tr style="font-size: 8pt"> <td style="width: 174px; text-align: left"> <span style="font-family: Verdana"><span style="color: #000099">Customer E-Vault Username:<br /> </span> <asp:TextBox ID="TextBox3" runat="server" Font-Names="Verdana" Font-Size="X-Small" Width="150px"></asp:TextBox><br /> </span> </td> <td style="width: 187px; text-align: left"> <span style="font-family: Verdana"><span style="color: #000099">Customer E-Vault Password:<br /> </span> <asp:TextBox ID="TextBox4" runat="server" Font-Names="Verdana" Font-Size="X-Small" TextMode="Password" Width="150px"></asp:TextBox><br /> </span> </td> <td style="width: 136px; text-align: left"> <span style="font-family: Verdana"><span style="color: #000099">E-Vault Storage Plan:<br /> </span> <asp:DropDownList ID="DropDownList2" runat="server" DataValueField="storage_plan" Font-Names="Verdana" Font-Size="X-Small" ForeColor="Navy"> <asp:ListItem Selected="True">Select Plan.....</asp:ListItem> <asp:ListItem>0-300MB</asp:ListItem> <asp:ListItem>300MB-2GB</asp:ListItem> <asp:ListItem>2GB-4GB</asp:ListItem> <asp:ListItem>4GB-6GB</asp:ListItem> <asp:ListItem>6GB-8GB</asp:ListItem> <asp:ListItem>8GB-15GB</asp:ListItem> <asp:ListItem>15GB-25GB</asp:ListItem> <asp:ListItem>25GB-35GB</asp:ListItem> <asp:ListItem>35GB-50GB</asp:ListItem> <asp:ListItem>50GB-100GB</asp:ListItem> <asp:ListItem>100GB-200GB</asp:ListItem> </asp:DropDownList><br /> </span> </td> </tr> <tr style="font-size: 8pt"> <td style="width: 174px; text-align: left"> <span style="font-family: Verdana"><span style="color: #000099">Analyst:<br /> </span> <asp:DropDownList ID="DropDownList3" runat="server" DataValueField="cust_analyst" Font-Names="Verdana" Font-Size="X-Small" ForeColor="Navy" Width="162px"> <asp:ListItem>Select Analyst.....</asp:ListItem> <asp:ListItem>Brock McFarlane</asp:ListItem> <asp:ListItem>Cameron Farrally</asp:ListItem> <asp:ListItem>Chad Huls</asp:ListItem> <asp:ListItem>Eric Spinney</asp:ListItem> <asp:ListItem>Greg Freeman</asp:ListItem> <asp:ListItem>Harald Smit</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><br /> </span> </td> <td style="width: 187px; text-align: left"> <span style="font-family: Verdana"><span style="color: #000099">Today's Date: (mm/dd/yyy)<br /> </span> <bdp:bdplite id="BDPLite1" runat="server" borderstyle="None" cssclass="bdpLite" dateformat="ShortDate" font-bold="False" font-names="verdana" font-size="X-Small" forecolor="Navy" selecteddate=""></bdp:bdplite> </span> </td> <td style="width: 136px; text-align: left"> <br /> </td> </tr> <tr style="font-size: 8pt"> <td colspan="3"> </td> </tr> <tr style="font-size: 8pt"> <td colspan="3" style="text-align: left"> <span style="font-family: Verdana"><span style="color: #000099"><strong> <br /> Backup Data<br /> <hr style="color: #000099" /> </strong><span>Please enter all directories and/or files and folders the customer wishes to have backed up. Be thourough yet brief as this is for historical and record keeping purposes.<br /> <br /> </span></span></span> </td> </tr> <tr style="font-size: 8pt"> <td colspan="3" style="text-align: left"> <asp:TextBox ID="TextBox5" runat="server" ForeColor="#000000" Height="130px" MaxLength="200" TextMode="MultiLine" Width="503px"></asp:TextBox><br /> </td> </tr> <tr style="font-size: 8pt"> <td style="width: 174px"> </td> <td style="width: 187px"> </td> <td style="width: 136px"> </td> </tr> <tr style="font-size: 8pt"> <td colspan="3" style="text-align: left"> <span style="font-family: Verdana"><span style="color: #000099"><strong> <br /> BackupExec / NTBackup<br /> <hr style="color: #000099" /> </strong><span>Does the customer have another backup program running that backs up their files to tape or another physical media.<br /> <br /> </span></span></span> </td> </tr> <tr style="font-size: 8pt"> <td colspan="2" style="height: 41px; text-align: left"> <asp:RadioButtonList ID="RadioButtonList1" runat="server" Font-Names="Verdana" Font-Size="X-Small" ForeColor="Navy" RepeatDirection="Horizontal" Width="127px"> <asp:ListItem Value="Yes">Yes</asp:ListItem> <asp:ListItem Value="No">No</asp:ListItem> </asp:RadioButtonList><span style="font-family: Verdana"><span style="color: #000099">If "Yes", what program do they use?</span> <asp:TextBox ID="TextBox6" runat="server" Font-Names="Verdana" Font-Size="X-Small" Width="200px"></asp:TextBox><br /> </span> </td> <td style="width: 136px; height: 41px"> </td> </tr> <tr style="font-size: 8pt"> <td style="width: 174px"> </td> <td style="width: 187px"> </td> <td style="width: 136px"> </td> </tr> <tr style="font-size: 8pt"> <td colspan="3" style="text-align: left"> <span style="color: #000099"><span style="font-family: Verdana"><strong> <br /> E-Mail Notifications<br /> <hr style="color: #000099" /> </strong><span>Does the customer wish to receive weekly reports about their backups? (This includes what directories are being backed up, how much storage space they have used on their plan and how much storage space is remaining).If so enter their e-mail address below. If they don't want to receive notifications, you can skip this section.<br /> <br /> </span></span></span> </td> </tr> <tr style="font-size: 8pt"> <td style="width: 174px; text-align: left"> <asp:TextBox ID="TextBox7" runat="server" Font-Names="Verdana" Font-Size="XX-Small" ForeColor="Navy" Width="201px"> N/A</asp:TextBox></td> <td style="width: 187px"> </td> <td style="width: 136px"> </td> </tr> <tr style="font-size: 8pt"> <td style="width: 174px"> </td> <td style="width: 187px"> </td> <td style="width: 136px"> </td> </tr> <tr style="font-size: 8pt"> <td style="width: 174px; height: 26px"> </td> <td style="width: 187px; height: 26px; text-align: left"> <asp:Button ID="Button2" runat="server" BackColor="White" BorderColor="Navy" BorderStyle="Solid" BorderWidth="1px" Font-Names="verdana" Font-Size="Small" OnClick="InsertData" Text="Submit Form" /></td> <td style="width: 136px; height: 26px"> </td> </tr> </table> </div> <div style="text-align: center"> <img src="/images/div.jpg" /><br /> <br /> <span style="font-size: 7pt; font-family: Verdana">Copyright 2006 Weston Technology Solutions </span> </div>
let's say I have a table named "myTable" in a SQL database:
UniqueID FirstName FamilyName
1 Elizabeth Moore
2 Chris Lee
2 Robert McDonald's
I want to create a SQL query should contain a parameter for example: SELECT * FROM myTable WHERE UniqueID = @TextBox OR FirstName = @TextBox OR FamilyName = @TextBox,
and when I type in my TextBox the ' * ' character, it should retrieve the whole table...
hope anybody understood, will be happy to explain more.
I have a problem loading data from a flat file into a DB2 Dtabase by using the OLE DB Provider for DB2.
I read the data from a flat file in the unicode format and as soon as the data is to be written in the DB2 database the following error occurs and the loading process is aborted:
Information: 0x402090DE at Data Flow Task, Flat File Source [813]: The total number of data rows processed for file "C:Dokumente und EinstellungenAdministratorDesktopSSIS1.txt" is 2. Error: 0xC0202009 at Data Flow Task, OLE DB Destination [842]: An OLE DB error has occurred. Error code: 0x80040E53. Error: 0xC0047022 at Data Flow Task, DTS.Pipeline: The ProcessInput method on component "OLE DB Destination" (842) failed with error code 0xC0202009. 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. Error: 0xC0047021 at Data Flow Task, DTS.Pipeline: Thread "WorkThread0" has exited with error code 0xC0202009. Information: 0x40043008 at Data Flow Task, DTS.Pipeline: Post Execute phase is beginning.......
......Warning: 0x80019002 at Package: The Execution method succeeded, but the number of errors raised (3) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors. SSIS package "Package 1.dtsx" finished: Failure.
I dont know waht those error codes meanand I tried so many things already. The tables in the database are created correctly and also, SSIS can read the data from the database if I use the preview function, but somehow, the program never starts to write data into the database for some reason. Can anyone help me???
I have a problem loading data from a flat file into a DB2 Dtabase by using the OLE DB Provider for DB2.
I read the data from a flat file in the unicode format and as soon as the data is to be written in the DB2 database the following error occurs and the loading process is aborted:
Information: 0x402090DE at Data Flow Task, Flat File Source [813]: The total number of data rows processed for file "C:Dokumente und EinstellungenAdministratorDesktopSSIS1.txt" is 2. Error: 0xC0202009 at Data Flow Task, OLE DB Destination [842]: An OLE DB error has occurred. Error code: 0x80040E53. Error: 0xC0047022 at Data Flow Task, DTS.Pipeline: The ProcessInput method on component "OLE DB Destination" (842) failed with error code 0xC0202009. 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. Error: 0xC0047021 at Data Flow Task, DTS.Pipeline: Thread "WorkThread0" has exited with error code 0xC0202009. Information: 0x40043008 at Data Flow Task, DTS.Pipeline: Post Execute phase is beginning.......
......Warning: 0x80019002 at Package: The Execution method succeeded, but the number of errors raised (3) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors. SSIS package "Package 1.dtsx" finished: Failure.
I dont know waht those error codes meanand I tried so many things already. The tables in the database are created correctly and also, SSIS can read the data from the database if I use the preview function, but somehow, the program never starts to write data into the database for some reason. Can anyone help me???
4 Layered Web Application for Inserting data into a database using sql server as the back end and a web form as the front end using C# . Can someone provide with code as I am new to this architecture and framework. Better send email. Thanks In Advance, A New Bie
I am new to ms SQL. I only have the use of the Enterprise Manager. Creating tables I understand. However I am confused on how to add data to a table or view the data in a table. Can this be done through Enterprise Manager? If I am adding a large amount of data do I have to use the query window. This seems like a tedious method. In Access yo have a form basically pop up where you can type in the record sets. Any advice would be appreciated! Sincerely, Bill Bequette
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?
We are using SQL server 7.0 as RDBMS for BaaN ERP. We have created the database file in E: drive. Now E: drive is going to be exhausted, We are trying to add a new file at different location. When we add the file into database it creates a file with default extension .ndf but previous file has the extension .mdf. should we change the extension of new file to .mdf or we should continue with default extension .ndf.
is it necessary to add a secondary file group or we add a file to the existing primary group.
We have 1 TB database and we recently got space so 1) can i add data files and put in different disk in production hours 2) what are the effects of doing this. JUst want to get expert advise
Hello, My company Intranet has a form that agents can use to post their comments about the company to upper management, but our customer service department would like to modify the form so that the agent has to pick from a comment type. The dropdown options on the form will be as follows: ComplimentsComplaintsGeneral CommentsSuggestions Each dropdown option has a designated table in a SQL DB.Using postback on the same page, I need to change which fields of the form are visible based upon which dropdown selection the user chooses, and I need the fields to then be inserted into the table that corresponds with the dropdown selection item. For example: If the Compliments dropdown selection is picked, I need a text box to show for the user's location, the name of the customer, account number, and the message box. Once the submit button is clicked, the characters in these boxes need to be inserted into the Compliments table using its data adapter. However, if the user selects Suggestions, the name of the customer and the account number should not be visible, since these fields do not exist and when the submit button is pressed, the Suggestions table should be updated. If you need more information, I will provide whatever is needed. As always, thanks for everyone's assistance. Chris
I'm using SQL server on godaddy.com, and for the life of me, tried all freakin day yesterday to get a form to send data to my table, and can't get it to work for the life of me
I think the asp form sends the information to the asp page that is to add the information to the tables correctly, but am not entirely sure, so here is the code for the form:
Now for the page that is giving me the problem (I think). I'm pretty sure I'm fudging up the connectivity somewhere because all I get is an http 500 error every time I try to upload the information.
Why won't it bloody connect?!?!
Also, is the DIM function on this page used to hide important information? If you guys can help me fix this, I'd be incredibly, incredibly greatful, I'm frustrated out of my mind!
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="CP_ACP"%> <html> <head> <title>piece of shit page</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <% Dim oConn, oRs Dim qry, connectstr Dim db_name, db_username, db_userpassword Dim db_server
Hello, I am tring to add a string my database. Info is added, but it is the name of the string, not the data contained within. What am I doing wrong? The text "Company" and "currentUserID" is showing up in my database, but I need the info contained within the string. All help is appreciated!
Imports System.Data Imports System.Data.Common Imports System.Data.SqlClientPartial Class _DefaultInherits System.Web.UI.Page
Protected Sub CreateUserWizard1_CreatedUser(ByVal sender As Object, ByVal e As System.EventArgs) Handles CreateUserWizard1.CreatedUser 'Database ConnectionDim con As New SqlConnection("Data Source = .SQLExpress;integrated security=true;attachdbfilename=|DataDirectory|ASPNETDB.mdf;user instance=true") 'First Command DataDim Company As String = ((CType(CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("Company"), TextBox)).Text) Dim insertSQL1 As StringDim currentUserID As String = ((CType(CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("UserName"), TextBox)).Text) insertSQL1 = "INSERT INTO Company (CompanyName, UserID) VALUES ('Company', 'currentUserID')"Dim cmd1 As New SqlCommand(insertSQL1, con) '2nd Command Data Dim selectSQL As String selectSQL = "SELECT companyKey FROM Company WHERE UserID = 'currentUserID'"Dim cmd2 As New SqlCommand(selectSQL, con) Dim reader As SqlDataReader '3rd Command Data Dim insertSQL2 As String insertSQL2 = "INSERT INTO Company_Membership (CompanyKey, UserID) VALUES ('CompanyKey', 'currentUserID')"Dim cmd3 As New SqlCommand(insertSQL2, con) 'First CommandDim added As Integer = 0 Try con.Open() added = cmd1.ExecuteNonQuery() lblResults.Text = added.ToString() & " records inserted."Catch err As Exception lblResults.Text = "Error inserting record." lblResults.Text &= err.Message Finally con.Close() End Try '2nd Command Try con.Open() reader = cmd2.ExecuteReader()Do While reader.Read() Dim CompanyKey = reader("CompanyKey").ToString() Loop reader.Close()Catch err As Exception lbl1Results.Text = "Error selecting record." lbl1Results.Text &= err.Message Finally con.Close() End Try '3rd Command Try con.Open() added = cmd3.ExecuteNonQuery() lbl2Results.Text = added.ToString() & " records inserted."Catch err As Exception lbl2Results.Text = "Error inserting record." lbl2Results.Text &= err.Message Finally con.Close()End Try
HiI am using Visual Web Developer 2005 Express and SQL Server Express 2005.From Northwind I can display data to Gridview.Could someone point me in the right direction on two points.How do I start a new database (.mdf) - I cannot find this option.I can change Northwind around - but I want to start my own database. Once I have that sorted - how can I "insert" data into database using a dropdown box?A "dropdown" box such as you would find online. Thanks in advance.Stephen
I've made a form and now all I want to do is save everything in the form into a new database file but I don't know how. I'm using Visual Web Developer 2005. Somehow I'm guessing that I have to set something somewhere so when the submit button is hit, it knows to save it to a database file which doesn't exist yet so it would have to create it. It should be easy but I can't figure it out.
I'm trying to do an extremely simple task here: add information from a signup form into an SQL database. Sadly, I can't figure out how to get the values into the DB.
I have a registration form, and upon the user clicking the submit button, I want the information to be processed and sent to my SQL database. Each textbox (i.e. username, password, email address) has a corresponding field in a table in the database.
How can I accomplish this? I under stand that I will need an onclick event handler.
Old Frontpage user here... I need to submit a form to a database, like in Frontpage and store the database on the web server. How do I accomplish this with Visual Studio Express...is there a ASP.NET component or do I need to code it? Many Thanks, Jake p.s. my ASP.NET 2.0 books are coming for Christmas!
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() { }
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
I'm trying to make a query to insert data form xls file to my database and it's working
Here's my code
INSERT INTO MY_TABLE SELECT SAP_NBR, PERIOD, ANSWER, OSAT, SCORE FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0', 'Data Source="C: ipTMP_Aubrygsi_osat.xls"; User ID=Admin;Password=;Extended properties=Excel 8.0')...Sheet1$ WHERE SAP_NBR is not null AND PERIOD is not null AND ANSWER is not null AND OSAT is not null AND SCORE is not null
And I would like to verify if there no sap_nrb and period already the same in the database so I add : AND SAP_NBR not in MY_TABLE.SAP_NBR AND PERIOD not in MY_TABLE.PERIOD
Hi, I'm not very asp.net savy and could not find any solid examples of what I need done. I have one text box on my page and one submit button. I would like the information entered from the text box to go into a SQL database when clicking on the submit button. I'm not sure what the exact coding should be in order to get this operating the way I want. I'm coding in VB, this is what I have so far:<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"><title>Untitled Page</title> <script language="javascript" type="text/javascript"> // <!CDATA[function Submit1_onclick() { } // ]]></script> </head> <body> <form id="form1" runat="server"> <div> <input id="Text1" type="text" /><br /> <input id="Submit1" type="submit" value="submit" onclick="return Submit1_onclick()" /></div></form> </body> </html> Thanks, Derek
I am creating a website with a form that users can fill up the information. This form is about the school's information of the users. After fill up this form, the users will have to click the submit button that will submit the form to be saved in a database.
I have created the database for that form. My question is how can I save the result of this form to my database. Let's say I have 5 textboxes in that form, name, school's name, school's address, major, and comments.
Hi, My problem is I only can put the database table to another database.I use example to ********. For example. My database name is Career. The user has a database name called Online. The Online has already some tables in the database they created before. I just need load my database career tables to the Online database. My database career has seven tables. These tables has a reltionship for each other. I just need to load these table to the Online database, But don't build relation to the tables that already exist in the Online database. Besides, I want to know how load the stored procedure from my database to another database.