.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Reading data from .doc or .docx and inserting into db

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net


A vendor is providing content which needs to be inserted into the db. The content is basically questions with options and explanations. An example is below.


View Complete Post

More Related Resource Links

Reading and checking .CSV File and Inserting Data to SQL server



I have got a page in which there is a file upload option where I have to upload/import the csv file. What I want to do is to check if the correct format of file is uploaded for instance if any other than csv file is uploaded, the system should give an error message. Also what I need to do is to check certain fields of the csv file for instance there are some mandatory fields in the csv file which should be there like name , postcode, How can I check that these fields are not empty . After performing these task, the system should automatically upload the csv file onto the sql sever 2008. Any ideas  or tutorial ... will be highly appreciated. 

Inserting data to ExcelSheet


Hi all,

I have a web form, in that i'll enter daily expense details.

After i press save button, the data i entered are saved into an excel sheet.

I don't have idea how to save the data to excel sheet, so your help for this greatly welcome. 

Reading values from data access component individually



I am trying to pick data from the database through data access layer and use those values in different text boxes on the page.Basically on a click on the form, modal popup is planned to read the database and put the values into different text boxes which can be latter changed/ updated.

 What I am unable to do is accessing those values on the form itself progamatically. I will be thankful for any ideas and help.

My data access component is as follows:




new SqlParameter ("@reg_id", SqlDbType.Int ));"@reg_id"].Value=reg_id;try




Reading xml data from xml string




i have string like below:

<?xml version="1.0" encoding="utf-8" ?>










reading xml data and insert into database table

hi friends, .very urgent for me so only i send following script i create for read xml data and to import to table. i got result for reading xml and rows are added to table but the values are showing null pls clarify this problem. thanks alter procedure pizza_sales ( @xml xml ) as begin INSERT INTO pizza_xml (LOC_CODE, CUST_CODE, PRODUCT_ID, INV_TYPE, INV_NO, INV_DT, INV_QTY_IN_INV_UOM, INV_RATE_IN_BS_CURR, INV_VU_IN_INV_CURR, -- TOTAL_DISC_IN_BS_CURR, NET_INV_VU_IN_INV_CURR, NET_INV_VU_IN_BS_CURR, TOTAL_TXES_IN_BS_CURR ) select table1.column1.value('@LOC_CODE','nvarchar(75)'), table1.column1.value('@CUST_CODE','nvarchar(75)'), table1.column1.value('@PROD_CODE','nvarchar(75)'), table1.column1.value('@INV_TYPE','nvarchar(50)'), table1.column1.value('@INV_NO','nvarchar(100)'), table1.column1.value('@INV_DT','datetime'), table1.column1.value('@INV_QTY_IN_INV_UOM','numeric(28,8)'), table1.column1.value('@INV_RATE_IN_BS_CURR','numeric(28,8)'), table1.column1.value('@INV_VU_IN_INV_CURR','numeric(28,8)'), --table1.column1.value('@TOTAL_DISC_IN_BS_CURR','numeric(28,8)'), table1.column1.value('@NET_INV_VU_IN_INV_CURR','numeric(28,8)'), table1.column1.value('@NET_INV_VU_IN_BS_CURR','numeric(28,8)'), table1.column1.value('@TOTAL_TXES_IN_BS_CURR','numeric(28,8)') from @xml.nodes('pizza/pizzaxml')as table1(column1) end declare @id

Inserting data from a text box

Hi All, I am trying to insert data in one of the tables using SQL Server. Below is the sql command: string insertSQL = "Insert into CUSTOMERS (" + " CUSTOMER_NAME" + ") VALUES (" + custname.Text + ")"; SqlCommand insertcmd = new SqlCommand(insertSQL, myConnection); //Add parameters insertcmd.Parameters.AddWithValue("@ID", custname.Text); When I insert the customer name in the custname text box it is throwing me an error called "Invalid column name 'ABC'". While ABC is the customer name entered in the custname text box. Please suggest!! Regards, Abhinav Mehta

Reading data from Excel 2007

I am attempting to read data from an uploaded spreadsheet using ACE.OLEDB. The code, which is running fine on dev and test machines for XL2003/2007 reports "External table is not in the expected format" error on connecting on the production server for XL2007 only. The code is Dim connectionString As String = "provider=Microsoft.Ace.OLEDB.12.0;" _ & "Data Source='" & ImportData.FullName & "';Extended Properties=Excel 12.0;" LogWebActivity.LogThis("Entering POPSUKD, ConStr=" & connectionString, LogWebActivity.LogDetailLevel.DetailAndData) Dim con As New System.Data.OleDb.OleDbConnection(connectionString) LogWebActivity.LogThis("Dimmed con", LogWebActivity.LogDetailLevel.Debugging) Try Dim cmdSelect As New System.Data.OleDb.OleDbCommand("SELECT * FROM [" & WorksheetName & "$]", con) Dim adapter As New System.Data.OleDb.OleDbDataAdapter(cmdSelect) Dim dS As New Data.DataSet LogWebActivity.LogThis(cmdSelect.CommandText, LogWebActivity.LogDetailLevel.Debugging) con.Open() LogWebActivity.LogThis("Opened Connection", LogWebActivity.LogDetailLevel.Debugging) adapter.Fill(dS, WorksheetName) LogWebActivity.LogThis("Filled DataAdapter", LogWebActivity.LogDetailLevel.Debugging) _SKUS = dS.Tables(W

The maximum string content length quota (8192) has been exceeded while reading XML data.

Hi, I have been working on implementing a WCF service and have run into this problem with the maxStringContentLength.  I have read a bunch of posts here on how to correct it and none of them have worked.  I have updated my web.config in my local IIS5 published service to be maxStringContentLength="2147483647" and have updated my application's app.config to be maxStringContentLength="2147483647".  I delete all DLL's, rebuild, restart IIS, make sure all VS 2008 virtual webs are stopped, republish multiple times...even reboot my machine and I continually receive the following error message:The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempuri.org/qlStatement. The InnerException message was 'There was an error deserializing the object of type System.String. The maximum string content length quota (8192) has been exceeded while reading XML data. This quota may be increased by changing the MaxStringContentLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader. Line 171, position 35.'.  Please see InnerException for more details.I am running the service on my local machine: Win XP SP2, IIS5, .Net 3.5, VS 2008Here is my WCF service's servicemodel section of the web.config:    <system.serviceModel>    <bindings>      <wsHt

Reading data to a table from a stored proc

This has me brain locked.  1. I've got a stored procedure.  2. It does a select with a couple joins.  I want to take the results of that stored proc and read them into some a table -- temp table would be ideal.  here's my (really tough) constraints... these really complicate things: 1. the stored proc uses dynamic SQL. As a consequence, I don't know the columns it's going to return (it's kind of the whole point of using it).  2. Since the stored proc uses dynamic SQL, it needs to use sp_executesql internally.    What won't work(i don't think?): 1. I can't create a function that returns a table and does a "return select * from....", since you can't (I don't think?) call a stored a stored proc in the return statement of a function 2. I can't just do an "Insert into #xyz exec .." because I can't pre-define the temp table (I think this is needed?). 3. I don't have a linked server. and i'd rather not. All of this runs local in the same instance of SqlServer, and will have to handle loads of volume (each hit will return a few million rows).  So (I think?) OPENQUERY  is out.  4. OPENROWSET is a possibility, I suppose, but again, everything is running locally. I think that goes through OLEDB (?) and I'm not sure that's even an option.    THOUGHTS???  HELP?? is it even possible?? Pl

inserting an array of data into a database table

im looking to insert an array of information into a database tableessentially what id like to do is something like this:            objCmd = New OleDb.OleDbCommand("INSERT INTO pluINFO VALUES *", objConn)            For j = 0 To 265                objCmd.Parameters.Add( info(j) )            Next this code gives me a syntax error for the insert statement is there anyway i can set the insert statement that would allow me to add each element of the array(looping through rather than hardcoding several hundred entries) into the table?any input appreciatedThanks

inserting data after caliculation using stored procedure

hi my requirement is like i want to insert data to table after caliculationliketable name salaryhikecolumns salaryinput,20%hike, 25%hike and 30%hikesalaryinput column details  to be input by the user and hike is to be caliculated and inserted with 20%hike, 25%hike and 30%hike are columns of same table.plz help me.thank you very much.

Inserting images into mysql data using c#

hey dere,is dere any way that i can store or insert  images into the mysql database and retrieve them successfully just like textual data.thnks in advance...

inserting one table data to another after filtering nulls and duplicates

hi i have tbl_ip i want to filter nulls and duplicate to my tbl_ipfilter can u suggest me a stored procedure for this. data of tbl_ip is like below . ip NULL NULL NULL

Appointment validation checking and data inserting

I am beginner of asp.net and c#Currently i doing appointment website and need suggestions/ ideas. I have create a simple web form  with Calender Control as picture below enable users to select date and time. At the calender control, i have set that users can only select tuesday and thursday every month using DayRender. After that i put a DropDownList to display the time. Next step, i want to store the data into database, for example UserA make appointment on Date 21 September 2010, Time 1100 and make it unavailable for other bookings. When UserB makes appointment on same Date and Time, it will display information that the slot is booked/unavailable. To implement this, what approach should i take? When i insert the data into database should i convert the value of DropDownList to time format or just insert DropDownList.Text? If i just insert according to DropDownList.Text will it having problem in check the slot is booked or not? <asp:DropDownList ID="DropDownList1" runat="server"> <asp:ListItem>0900</asp:ListItem> <asp:ListItem>1000</asp:ListItem> <asp:ListItem>1100</asp:ListItem> <asp:ListItem>1200</asp:ListItem> <asp:ListItem>1400</asp:ListItem> <asp:ListItem>1500</asp:ListItem> <asp:ListItem>1600</asp:L

Problem when Inserting xml data into a table using OpenXml

Hi, i stuck with a problemam trying to insert data from xml file to sql server.i made query like thisSET NOCOUNT ON DECLARE @hDoc INT EXEC sp_xml_preparedocument @hDoc OUTPUT, '<NewDataSet>  <xs:schema id=''NewDataSet'' xmlns='''' xmlns:xs=''http://www.w3.org/2001/XMLSchema'' xmlns:msdata=''urn:schemas-microsoft-com:xml-msdata''>  <xs:element name=''Job''>     <xs:complexType>      <xs:sequence>        <xs:element name=''BillToNo'' type=''xs:string'' minOccurs=''0'' /> <xs:element name=''Colors'' type=''xs:string'' minOccurs=''0'' /> <xs:element name=''CompanyNo'' type=''xs:string'' minOccurs=''0'' /> <xs:element name=''CsrCode'' type=''xs:string'' minOccurs=''0'' /> <xs:element name=''CsrName'' type=''xs:string'' minOccurs=''0'' /> <xs:element name=''CustomerPoNo'' type=''xs:string'' minOccurs=''0'' /> <xs:element name=''DivisionOriginal'' type=''xs:string'' minOccurs=''0'' /> <xs:element name=''EstimateNo'' type=''xs:string'' minOccurs=''0'' /> <xs:element name=''FinalDeliveryDate'' type=''xs:string'' minOccurs=''0'' /> <xs:element name

The Maximum String contenet length quota(8192) has been exceeded while reading xml data

I am using WCF service and calling in vb6.0 application.
I am using typed contract moniker object to access the services from VB6.0. Everything working fine.
Service hosted in windows service using nettcp binidng. Service method return type is XMl string. While I try to access the method I am getting the error message "The Maximum String contenet length quota(8192) has been exceeded while reading xml data". I have modifed readerquota Service appconfig file and svcutil.exe generated client config file.
I put the client config fiel in vb application exe folder.

I have mentioned the Bindingconfiguration name also.

When I changed the cleint config file with junk data vb application giving the  same error. I am not sure whether VB 6.o using client config file.

Please help me.

<binding name="NetTcpBindingEndpoint" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxConnections="10" maxReceivedMessageSize

error in inserting data into the datasource


hello all i have a gridview and textbox i want to insert the data that typed in the textbox  into the gridview i can do this but in other culomn i just can insert number 
and when i type some world the error say:Invalid column name'every thing ' 

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="soal.aspx.vb" Inherits="soal" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <style type="text/css">
            width: 100%;
<body bgcolor="#fe9cef">
    <form id="form1" runat="server">
    <table class="style1">
                <asp:GridView ID="GridView1" runat="server" AllowSorting="True" 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend