.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

Dynamic tables using file names

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :


      I am having 28 fixed length files. All are of different data types, lenghts and do have millions of records. I have to load this data into 28 tables, which has to be dynamically created based on the columns of the input files. Can some one suggest me on how to achieve this ?

Thanks a lot.


Ansul G

View Complete Post

More Related Resource Links

Uploading to SQL Server using AJAX muiltiple file uploader and dynamic SQL Server Tables


I am getting an error on the following code when trying to pload files directly to a database.  

 Incorrect syntax near ','.

 Incorrect syntax near 'image'.


    Private Sub Uploader_FileUploaded(ByVal sender As Object, ByVal args As UploaderEventArgs)

        Dim data() As Byte = New Byte((args.FileSize) - 1) {}

        Dim stream As Stream = args.OpenStream

        stream.Read(data, 0, data.Length)

    End Sub


Private Sub ButtonTellme_Click(ByVal sender As Object, ByVal e As EventArgs)


        Dim objConn As New SqlConnection("Data Source=mrpoteat.db.2798093.hostedresource.com; Initial Catalog=mrpoteat; User ID=mrpoteat; Password=Colgate23;")


        Dim strCommandText As String = ""

        For index = 1 To Attachments1.Items.Count Step 1

            strCommandText += "pic" + index.ToString() + Space(5)

Where is the document library setting "Unique file names"?

Live can be so simple if only… ;-).   When using DMS functionality unique file names must be possible. The name is an unimportant attribute when using Meta data. So why can I not choose somewhere in the document library settings something like:   ·         Generate unique filenames Or ·         Do not allow overwrite existing filenames   Maybe in the first service pack?   MS? Please, please, please  

How to MAP Tables in Linq .dbml file

I am using VS 2010I've created LiNQ .dbml file via   .. Model>Add New Item>Data>LINQ to SQL ClasesI've put table on designer surface using drag & drop.I've done all this from one tutorial. There Is Mapping with arrows between tables in tutorial. How can i do this.. ???Can Any one Help Me Please..Thanks

URL routing with a dynamic .sitemap file

Hi,I've implemented URL routing now I've upgraded to .NET 4 following http://weblogs.asp.net/scottgu/archive/2009/10/13/url-routing-with-asp-net-4-web-forms-vs-2010-and-net-4-0-series.aspx.The only problem I've encountered is with the .sitemap file. If I put, for example: <siteMapNode url="~/recipes/Starters" title="Browse Starters"> it renders correctly. However, I need to do something like this: <siteMapNode url="~/recipes/{category}" title="Browse {category}"> - i.e. dynamically giving a titleOr, I'd settle for something like this: <siteMapNode url="~/recipes/*" title="Browse Recipes"> - i.e. covering all recipe pages Has anyone found a nice solution to this?

How to have dynamic column names in an Excel Destination?

I have a situation where both the column names in the source (SQL) and destination (Excel) are being created dynamically. The number of columns, their positions, and datatypes remain the same. How do I change the OLE DB Source and Excel Destination meta-data to handle these changes at run-time?

Import a flat file with combined data into separate SQL tables using SSIS

I have a flat text file (comma delimited) that is essentially multiple files, each with its own format, combined into one file. The file is coming from an external software vendor so unfortunately we don't have much choice but to work with what we are receiving. Here is an example of what the file could look like: Customer Data CustID,FName,LName,PhNum,Email 12345,John,Smith,,jsmith@gmail.com 12346,Jane,Doe,8001111111,jdoe@hotmail.com Customer Plan CustID,PlanType,PlanName,PlanStart 12345,0,Plan1,01/01/2010 12345,2,PlanVis,01/01/2010 12346,3,PlanLf,04/01/2010 12346,0,Plan1,01/01/2010 Customer Payment CustID,LastPayment,Amount 12345,09/01/2010,100.00 12346,05/01/2010,50.00 There is an empty line between each 'section' of data. I adapted a VB script I found online that can take the incoming file and save off each section as its own file so that each one can be separately imported, but this seems inefficient. I'm really new to SSIS in general, but it seems like it shouldn't be that difficult to take the data, split it where there is an empty line, and then import each section into the appropriate SQL table. Any ideas would be most welcome. Thanks!  

How to find the Number of Tables Present in an XML File?

Dear All,Can any one let me know "How to find the number of Tables present in a XML Schema File"?Thanks and Regards,G.V.N.Sandeep

Creating a dynamic excel file


Is it possible that i can create a dynamic excel file (destination)


ex, i want to create a Dyanamic Excel destination file with a filename base on the date

this will run on jobs. Is this possible?

11172006.xls, 11182006.xls

How to read all function/method names from .cs file


 Hi everyone,

Normally i answer to the peoples questions here but today i am posting a question for a answer :)

I have a .cs file and i want to read all function/method names from it.

This .cs file is not part of my project or solution other wise i would have used reflection or codedom to do so.

The .cs file is a file on a disk to which i can accessing by giving its physical path say "C:\Sample.cs"

Is there any possibility that i can fetch all the function names declared in Sample.cs

Note: I am doing this for one of my requirement to find out dependencies in code

For example If class A is using some function from class B then class A is dependent on class B. this i need to find out and both this class files are simply a files residing on disk not even part of my project. 

User will select a directory first then any one of the .cs file in that directory and will click on button to find dependencies of that .cs file.

The application should traverse all other .cs files in that directory and find out on how many other .cs files the selected file is dependent.

Import file names from a folder


First of all, I only know VB (I know that isn't great but it's all I got).

Second, I have a folder with 200+ pictures.  I want to get the names of each of the pictures to the database. 

Last, would it be easier to import and export the images into the database (I want my webpage to be able to show the images once they are in the database)?



how to avoid dynamic change of controls names in ascx page sharepoint


when creating webpart contols using ascx in sharepoint deployed . the webpart added to site. the controls name is page has changed. please provide detials to avoid name changes

Thanks in advance

Dynamic file name in File based report delivery


I am trying to implement a report delivery mechanism which is file based. So the report will be generated in pdf or excel and placed in file share location.  The name of the file needs to be dynamic.  For e.g. : if the report I am running is Daily sales for store 101 with a sales amount of $150 and for the date 03/22. I need to generate a pdf with file name dailysales_101_150_032210.pdf

There are some parameterized report generation scenarios as well. In that case the report name should include the parameters provided. In the above example itself if all the values above are provided as parameter, the report should be generated for the given parameter and the name should contain the parameter.

Has anyone had this requirement and implemented a solution before ? Can this be implemented in a standard subscription & data driven subscription. any custom code is required in order to implement this or can this be done by configuration in SSRS ?

thanks for your help.


how to collect all file names from remote server in c#



I have many images on remote server say http://images.foo.com/222 & i want to access file names of all files that resides in the folder 222 on http://images.foo.com/.

i have tried following code but getting error "virtual path is not valid" :

imageserver = http://images.foo.com/222;
DirectoryInfo di = new DirectoryInfo(imageserver); // line giving exception
FileInfo[] rgFiles = di.GetFiles();
string simagename = "";
if (rgFiles.Count() > 0)
foreach (FileInfo fi in rgFiles)
//collect each filename from here

Please help
thanks in advance

How to output data from master detail tables into text file but on different lines.



I have a requirement to output data from two tables, a master table and a detail table, to a text file such that the output looks like the following:

master record 1

detail record  1 1

detail record   1 2

master record 2

detail record  2 1

master record 3

detail record 3 1

detail record 3 2

detail record 3 3



Is this possible in one query?  I am sufficiently familiar with the bcp utility to do the output from any of the tables separately but have some difficulty with doing it for the two tables and have the result structured as outlined above.

Dynamic directory location for "Flat File Source"



I am using a "Flat File Source" to read from a source file. Now I want the directory location to be dynamic because it will change during migration from development to UAT to Production.

Can anyone help me here on this. Ofcourse my intention is not to open and modify the package after migrating into a different environment. Actually I want to store the directory location in a table and want the "Flat File Source" to read the location form that table duing runtime. But not sure whether can I achieve this or not. If yes then how?

Regards - Koushik

Import List of Worksheet Names from Multiple Sheets Excel File

I am only interested in OPENROWSET/OPENQUERY or xp_cmdshell solutions. Thanks.
Kalman Toth, SQL Server & Business Intelligence Training; SQL 2008 GRAND SLAM
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