.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

Simple Excel Import Question

Posted By:      Posted Date: September 16, 2010    Points: 0   Category :Sql Server
I have an excel file I am importing into a table. The excel file is named with a date (02102010_Excel_file.xls). I created a very simple import package. This simple two object package - Excel Source to OLE DB destination works just fine. But..   My problem is that the Excel file name will change every day to todays date (09162010_ExcelFile.xls) So,  I need to change my Excel Import  to something like *.xls but that doesn't work. How can I Import a *.xls file? qeqw

View Complete Post

More Related Resource Links

Entity framework simple question




First I am newbie using EF - so sorry on this basic question


I have a Project Table that relate to Company Table


When I Map with EF I Do not have property of CompanyId in the Project Object

But I have related Company Object


For example

Project p = new Project();

p.CompanyId è does not exist!

When I try addingit myself I get this error:

If I need just the Company id, and I don't want get it like

p.Company.CompanyId - because than the application try connect again to the DB and I don't want this, because I need just the CompanyId.

What the best regular way to get it?


A simple Data Modeling Question


I have a data modeling question that hopefully this fictious example will help explain.  My application is data driven and the classes reflect the tables to a large degree.   In this example my database has two tables:

  • VendorMaster with an int Primary Key of VendorID
  • VendorContact with an int Primary Key of ContactID

The VendorContact table also has a Foreign Key of VendorID in order to associate the contact with a specific Vendor.  In this example a Vendor can only have one contact.

My question is how to represent these two tables in terms of classes.  In my current design I have two classes:

  • VendorMaster
  • VendorContact

In order to represent the relationship between a VendorMaster and VendorContact, my VendorMaster class contains a property called VendorContact.

My questions are about the VendorContact class and how it represents the relationship between a VendorMaster and itself.

Option #1

The VendorContact class should contain an int property of VendorID

Option #2

The VendorContact class should contain a VendorMaster Property

I am not sure which option is the 'best' option to take. My concern is that if I go with option #2 that I would create a cyclical relationship between the VendorMaster and Vendo

GridView Question - Please Help Me...Should Be Simple...

Hello,I have what I think should be a simple GridView question but I can't find the answer.When I want to update a row in Gridview I click on the "Edit" link.  It takes me into the row of the GridView where I can edit the values.Here's how it looks:   CustomerID CompanyName Edit 001 IBM Microsoft Apple Google Edit 002 IBM Microsoft Apple Google Edit 003 IBM Microsoft Apple Google Edit 004 IBM Microsoft Apple Google When I click on "Edit" it looks like:   CustomerID CompanyName Edit 001 IBM Microsoft Apple Google Update Cancel IBM Microsoft Apple Google Edit 003 IBM Microsoft Apple Google Edit 004 IBM Microsoft Apple Google As you can see, I now have the ability to update the CustomerID.  I don't the user to be able to update the CustomerID, only the CompanyName via the DropDown.How can I change the GridView to ONLY allow me to update the CompanyName?ThanksJason   CustomerID CompanyName Edit 001 IBM Microsoft Apple Google Edit 002 IBM Microsoft Apple Google Edit 003 IBM Microsoft Apple Google Edit 004 IBM Microsoft Apple Google

how to import the data of excel into gridview1 using asp.net/c#

i m having excel file a.xlsi m having gridview1,fileupload1how to import excel file from fileupload1 get the destination of a.xls and show the values in gridview1if any boby knows full code answer/mail me at ponmanivannangj@mobiusservices.in

Simple data binding question

Newbie binding question here: is it possible to bind a control in XAML to a StaticResource by passing in the key via a data structure? Basically something like this: <TextBlock Text="{Binding ImageKey}" /> <Image Source="{StaticResource ResourceKey={Binding ImageKey}}" /> <-- doesn't work   The TextBlock binding on the first line works correctly, it extracts the key of the StaticResource from my data structure and displays it correctly. What I'm trying to do is get the Image control to bind to the StaticResource with that name (which happens to be a BitmapImage).      

Import Excel spreadsheet To Sharepoint List

Hi, I am having sharepoint 2010 RTM trial on Windows Server 2008 SP2. I want to populate csv filke data to new sharepoint list. I am using custom List Wizard to achieve this... When I Import csv on server then everything is fine but when i inport csv from client, i get the following error "The Specified is not valid Spreadsheet or contains no data to import" I have also checked to import excel workbook but it gives the same error on client and do great on server..... can anybody have any idea what is wrong ?? thanks

Simple Question

hi i m using Resource file for localization everything cool I pick the date value and i format it then i set the HtmlTableCell InnerText value the date value shows in Thai format i don't want to show the date in thai language format how can i prevent this 

Text truncated to 255 using SSIS ACE.oledbprovider to import excel 2007 spreadsheet

Hi All, Trying to use SSIS SQL 2005 to import an Excel 2007 file (.xlsx). I'm using Office 12.0 Access Database Engine OLEDB Provider with extended properties Excel 12.0;HDR=Yes;IMEX=1 The problem is when I have text with more than 255 characters. It basically defaults the source output to Unicode string[DT_WSTR] 255, If I change it it errors out. I have done the registry change according to http://msdn.microsoft.com/en-us/library/ms141683.aspx but I think it only applies to Excel source not OleDb Source. (A Excel source does give me a text instead of string )   I have also tried to increasing the length of output such as 4000 instead of 255 but it doesn't allow either.   Anybody can help?I'm stuck for a day. Thank you very much for your help. Regards, Koala  

Import Excel data into SQL Server express 2008

I have recently installed SQL express 08 and created a table to import excel data into.  Im running on a windows 7 64 bit OS i5 processor.  I've disabled the firewall (temporarily) and will set the necessary ports once this is working. I run the following query:  (which i found from multiple sources on the net) Select   * From OPENROWSET ( 'Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=C:\Users\Public\lenovoBkup\contacts\outlookFiles\noib2a.xls', 'Select * From [sheet1$]' )  and receive the following message: Msg 7308, Level 16, State 1, Line 1                                                                                  OLE DB provider 'Microsoft.Jet.OLEDB.4.0' cannot be used for distributed queries because the provider is configured to run in single-threaded apartment mode.  (how did they know i was single and living in an apartment? lol) so after research of the following message i restarted the system and relaunched man

Simple Viewstate question

Consider a page with asp textbox and a button. textbox's "EnableViewstate" property is set as "False". In page directive also i set the Page's "EnableViewstate" property as "False". If i type some text (i.e., like "This is sample text") on the text box and click the command button. After the postback also that text box contains the same text ("This is sample text") which i have typed. I have set the view state in page for false. Then how the state is maintained?  whats the reason behind that? Thank you.

Simple Question

 Hi Guys,    I had a webservice method, Whenever it throws an Exception Object, I justwant to catch that Exception Object from the AJAX function. Is it possible? If so, please give sample code snippet ASAP.  Thanks in advance.

import multiple Excel 2007 files using openrowset

hello, I Have a folder that includes multiple excle files (ver 2007), i am trying  to loop through each file using vbscript to import its data to sql 2000 using openrowset but i am getting this error in the openrowset line "[Microsoft][ODBC sql server driver] [sql server] [OLE/DB provider returned message: the microsoft office access DB engine cannot open or write to the file '', it is already open exclusively by another user or you need permission to view or write its data] code 80040E14 source microsoft OLEDB provider for ODBC drivers Any help please    

Excel Drop Table question

Can anyone tell me if the drop table syntax should delete only the data in a worksheet or clear the formatting as well. If not is there a way to clear all the formatting. Thanks

Import from excel

Hi All,   i have some questions, i receive an excelfile on a daily base. This excel file should be imported into a database.I have a couple of questions about it. 1.  Every line in the excelfile represents one record, but there are a lot of fields, like a persons name, adres, city. But also about items he or she has purchased. Now my idea was to create two seperate tables for the persons and for the items, than create a table for the join of the person and the purchased item. Would this would be a proper way, or should i leave all items in one table? 2. in case of creating two different tables, what would be the best way to extract the data en divided it over the two tables? so that a relationship stands..   I am using SQL2008 (MS)   Thanks in advance !!   Peter  

Simple question.... LINQ on Datatable

Hi all,Simple one this I am sure for those who use LINQ! :)I basically have two tables that will be stored in viewstate until I save the data to the database.  I need a way to query the datatables, delete remove etc.  Is this possible in LINQ?So for example, delete/select rows from the DataTable that have a particular ID etc...Thanks,Mark

SSIS Excel import skip first rows

Hello,1. Is it possible during import data from Excel to DB table skip first 6 rows for example?2. Also Excel data divided by sections with headers. Is it possible for example to skip every 12th row?Thank you,V. A.

Import excel sheet data to datagrid without using oledb

In my application(C#) i want to import excel sheet to show its data in DatatGridView i dont want to use oledb Need sample code can any any Help
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