Showing posts with label import. Show all posts
Showing posts with label import. Show all posts

Friday, March 30, 2012

Load data from CSV-File to sdf-File

I need to import data from csv-file to sdf-database (SQL CE 2.0).
When I copy the csv-file to my mobile device, it thakes more than 1 hour. The sdf-File later has a size of 20MB.

If I create an sdf-File (SQL CE 3.0) on the desktop, it just thakes a few minutes.


Is it possible to create an sdf-File (SQL CE 2.0) on the desktop legally?
My clients don't want to by the SQL-Server, because it should be an inexpensive solution.

Or is there another way to create the database with more performance?

ThanksIt is a good idea to generate the database on the desktop, zip and transfer to device, and then unzip. This is however, only possible with SQL CE 3.1. What prevents you from using 3.1 instead of 2.0?|||

No, it's not possible with SQL CE 2.0 That problem was solved in SQL CE 3.1.

Keep in mind support for SQL CE 2.0 is soon to run out, it's a very good idea to stay away from it. Don’t find yourself in the situation CEDB users found themselves after it was “suddenly” (after about 3 years advanced announcement) dropped from WM 5.0.

|||

On the device, there is windows CE 4.2 and compact Framework 2.0 installed.

My application is created with Visual Studio 2003.

If I install sqlce 3.1 on the device, then I am able to open an sdf file (that I created on the desktop) whith Query Analyzer. But my application still needs sdf files of version 2.0. What must be changed in my project, that i can work whith the new sdf-Files?

|||

You'd need to upgrade to VS 2005 and recompile your application with NETCF V2/SQL CE 3.1. Code probably would remain unchanged.

Existing databases (if any) must be converted from SQL CE 2.0 to SQL CE 3.x format.

Note VS 2005 does not officially support CE 4.2 devices but it works in most cases. You can get trial version and see if it works for you.

|||

OK, i upgradet to VS2005 and compiled my application again.

When I start the application now on device, i get the following error:

System.StackOverflowException in System.Windows.Forms.dll

This error dosn't occur in my old VS2003 project.

The debugger couldn't show me the line, where the error occurs. I just know, that it is not in my code.

So i did some tests and i determined, that the error didn't occur when I show a MessageBox before a special statement. The error will even not occur when i execute the statement later in the code.

Code Snippet

lblUserName.Text = MyDataSet.get_UserName(UserNumber);// here, i get the user name to the UserNumber

//from the database

panel1.Enabled = false;

txtUsr.Enabled = false;

lblUserName.Visible = true;

// MessageBox.Show("test"); //if I show this MessageBox, the error will not occur!

btnExit.Visible = false; //if I execute this line 4 lines later, the error will also not occur

btn_Yes.Visible = true;

btn_No.Visible = true;

label1.Visible = true;

label2.Visible = true;

this.Focus();

public string get_UserName(string UserNumber)

{

string returnwert = "";

this.Make_DB_Connection();

try

{

SqlCeCommand cmd = conn.CreateCommand();

cmd.CommandText = "SELECT username FROM AllUser WHERE usernr = '"+UserNumber+"';";

cmd.ExecuteNonQuery();

SqlCeDataReader rdr = cmd.ExecuteReader();

rdr.Read();

returnwert = rdr.GetString(0);

}

catch(Exception){}

Close_DB_Connection()

return returnwert;

}

public void Close_DB_Connection()

{

if(conn.State == ConnectionState.Open)

{

conn.Close();

}

}

|||

You should use stack trace on the exception to determine where infinite recursion occurred.

Most likely some code in event handlers you trigger by changing UI stuff.

|||

I Found the error and anything is working fine now.

Thank you verry much for your help!!!

load csv into SQL Server 2005

I have been pulling my hair out all afternoon trying to figure out an easy
way to import csv files into SQL Server 2005. They are perfmon logs in csv
format with TONS of columns, so creating the table and columns beforehand is
not practical. Isn't there some very easy, straightfoward way to simply
create a table and its columns based up on a csv file import?
thanks in advance,
BillIn SQL Server Managemetn Studio, right click on the database name and
choose Tasks... Import Data. This opens the Import Export Wizard.
Specify a Flat File data source. Give it your .csv file name. If
your csv file has column names in the first line, check that box. Use
Preview to see how it looks, and make whatever adjustments it takes to
make it look right. Keep following the steps, and you should end up
with a new table in your database. It will probably not be exactly
what you want!!! Data types will be a bit screwy, names will probably
not be formatted correctly.
Now script that table so you have a CREATE TABLE command. Edit it
until the names and types are right and make the new table. Then
repeat the process above, but this time in the panel labelled Select
Source and Table Views change the Desitnation to the new table you
created. Take through the rest of the steps and the data should load.
I have simplified things a bit - there are far too many details to go
into here - but the approach should get you where you want to go.
Good luck!
Roy Harvey
Beacon Falls, CT
On Tue, 2 May 2006 16:49:10 -0400, "bu" <bu@.nospam.com> wrote:

>I have been pulling my hair out all afternoon trying to figure out an easy
>way to import csv files into SQL Server 2005. They are perfmon logs in csv
>format with TONS of columns, so creating the table and columns beforehand i
s
>not practical. Isn't there some very easy, straightfoward way to simply
>create a table and its columns based up on a csv file import?
>thanks in advance,
>Bill
>|||Take a look at the Windows utility relog.exe
Linchi
"bu" wrote:

> I have been pulling my hair out all afternoon trying to figure out an easy
> way to import csv files into SQL Server 2005. They are perfmon logs in cs
v
> format with TONS of columns, so creating the table and columns beforehand
is
> not practical. Isn't there some very easy, straightfoward way to simply
> create a table and its columns based up on a csv file import?
> thanks in advance,
> Bill
>
>|||Do you know if that same procedure applies in SQL Server 2005 Express as
well as Standard and the others?
thanks again!
Bill
"Roy Harvey" <roy_harvey@.snet.net> wrote in message
news:06jf529da1ocliljc48nhkihkli7mm5j99@.
4ax.com...[vbcol=seagreen]
> In SQL Server Managemetn Studio, right click on the database name and
> choose Tasks... Import Data. This opens the Import Export Wizard.
> Specify a Flat File data source. Give it your .csv file name. If
> your csv file has column names in the first line, check that box. Use
> Preview to see how it looks, and make whatever adjustments it takes to
> make it look right. Keep following the steps, and you should end up
> with a new table in your database. It will probably not be exactly
> what you want!!! Data types will be a bit screwy, names will probably
> not be formatted correctly.
> Now script that table so you have a CREATE TABLE command. Edit it
> until the names and types are right and make the new table. Then
> repeat the process above, but this time in the panel labelled Select
> Source and Table Views change the Desitnation to the new table you
> created. Take through the rest of the steps and the data should load.
> I have simplified things a bit - there are far too many details to go
> into here - but the approach should get you where you want to go.
> Good luck!
> Roy Harvey
> Beacon Falls, CT
>
> On Tue, 2 May 2006 16:49:10 -0400, "bu" <bu@.nospam.com> wrote:
>
easy[vbcol=seagreen]
csv[vbcol=seagreen]
is[vbcol=seagreen]|||I do not believe it applies to Express, as I do not think Express
comes with SSIS. SSIS is what the Wizard builds.
Roy
On Tue, 2 May 2006 21:26:51 -0400, "me" <me@.nospam.com> wrote:

>Do you know if that same procedure applies in SQL Server 2005 Express as
>well as Standard and the others?
>thanks again!
>Bill
>
>"Roy Harvey" <roy_harvey@.snet.net> wrote in message
> news:06jf529da1ocliljc48nhkihkli7mm5j99@.
4ax.com...
>easy
>csv
>is
>

load csv into SQL Server 2005

I have been pulling my hair out all afternoon trying to figure out an easy
way to import csv files into SQL Server 2005. They are perfmon logs in csv
format with TONS of columns, so creating the table and columns beforehand is
not practical. Isn't there some very easy, straightfoward way to simply
create a table and its columns based up on a csv file import?
thanks in advance,
BillIn SQL Server Managemetn Studio, right click on the database name and
choose Tasks... Import Data. This opens the Import Export Wizard.
Specify a Flat File data source. Give it your .csv file name. If
your csv file has column names in the first line, check that box. Use
Preview to see how it looks, and make whatever adjustments it takes to
make it look right. Keep following the steps, and you should end up
with a new table in your database. It will probably not be exactly
what you want!!! Data types will be a bit screwy, names will probably
not be formatted correctly.
Now script that table so you have a CREATE TABLE command. Edit it
until the names and types are right and make the new table. Then
repeat the process above, but this time in the panel labelled Select
Source and Table Views change the Desitnation to the new table you
created. Take through the rest of the steps and the data should load.
I have simplified things a bit - there are far too many details to go
into here - but the approach should get you where you want to go.
Good luck!
Roy Harvey
Beacon Falls, CT
On Tue, 2 May 2006 16:49:10 -0400, "bu" <bu@.nospam.com> wrote:
>I have been pulling my hair out all afternoon trying to figure out an easy
>way to import csv files into SQL Server 2005. They are perfmon logs in csv
>format with TONS of columns, so creating the table and columns beforehand is
>not practical. Isn't there some very easy, straightfoward way to simply
>create a table and its columns based up on a csv file import?
>thanks in advance,
>Bill
>|||Take a look at the Windows utility relog.exe
Linchi
"bu" wrote:
> I have been pulling my hair out all afternoon trying to figure out an easy
> way to import csv files into SQL Server 2005. They are perfmon logs in csv
> format with TONS of columns, so creating the table and columns beforehand is
> not practical. Isn't there some very easy, straightfoward way to simply
> create a table and its columns based up on a csv file import?
> thanks in advance,
> Bill
>
>|||Do you know if that same procedure applies in SQL Server 2005 Express as
well as Standard and the others?
thanks again!
Bill
"Roy Harvey" <roy_harvey@.snet.net> wrote in message
news:06jf529da1ocliljc48nhkihkli7mm5j99@.4ax.com...
> In SQL Server Managemetn Studio, right click on the database name and
> choose Tasks... Import Data. This opens the Import Export Wizard.
> Specify a Flat File data source. Give it your .csv file name. If
> your csv file has column names in the first line, check that box. Use
> Preview to see how it looks, and make whatever adjustments it takes to
> make it look right. Keep following the steps, and you should end up
> with a new table in your database. It will probably not be exactly
> what you want!!! Data types will be a bit screwy, names will probably
> not be formatted correctly.
> Now script that table so you have a CREATE TABLE command. Edit it
> until the names and types are right and make the new table. Then
> repeat the process above, but this time in the panel labelled Select
> Source and Table Views change the Desitnation to the new table you
> created. Take through the rest of the steps and the data should load.
> I have simplified things a bit - there are far too many details to go
> into here - but the approach should get you where you want to go.
> Good luck!
> Roy Harvey
> Beacon Falls, CT
>
> On Tue, 2 May 2006 16:49:10 -0400, "bu" <bu@.nospam.com> wrote:
> >I have been pulling my hair out all afternoon trying to figure out an
easy
> >way to import csv files into SQL Server 2005. They are perfmon logs in
csv
> >format with TONS of columns, so creating the table and columns beforehand
is
> >not practical. Isn't there some very easy, straightfoward way to simply
> >create a table and its columns based up on a csv file import?
> >
> >thanks in advance,
> >Bill
> >|||I do not believe it applies to Express, as I do not think Express
comes with SSIS. SSIS is what the Wizard builds.
Roy
On Tue, 2 May 2006 21:26:51 -0400, "me" <me@.nospam.com> wrote:
>Do you know if that same procedure applies in SQL Server 2005 Express as
>well as Standard and the others?
>thanks again!
>Bill
>
>"Roy Harvey" <roy_harvey@.snet.net> wrote in message
>news:06jf529da1ocliljc48nhkihkli7mm5j99@.4ax.com...
>> In SQL Server Managemetn Studio, right click on the database name and
>> choose Tasks... Import Data. This opens the Import Export Wizard.
>> Specify a Flat File data source. Give it your .csv file name. If
>> your csv file has column names in the first line, check that box. Use
>> Preview to see how it looks, and make whatever adjustments it takes to
>> make it look right. Keep following the steps, and you should end up
>> with a new table in your database. It will probably not be exactly
>> what you want!!! Data types will be a bit screwy, names will probably
>> not be formatted correctly.
>> Now script that table so you have a CREATE TABLE command. Edit it
>> until the names and types are right and make the new table. Then
>> repeat the process above, but this time in the panel labelled Select
>> Source and Table Views change the Desitnation to the new table you
>> created. Take through the rest of the steps and the data should load.
>> I have simplified things a bit - there are far too many details to go
>> into here - but the approach should get you where you want to go.
>> Good luck!
>> Roy Harvey
>> Beacon Falls, CT
>>
>> On Tue, 2 May 2006 16:49:10 -0400, "bu" <bu@.nospam.com> wrote:
>> >I have been pulling my hair out all afternoon trying to figure out an
>easy
>> >way to import csv files into SQL Server 2005. They are perfmon logs in
>csv
>> >format with TONS of columns, so creating the table and columns beforehand
>is
>> >not practical. Isn't there some very easy, straightfoward way to simply
>> >create a table and its columns based up on a csv file import?
>> >
>> >thanks in advance,
>> >Bill
>> >
>

Monday, March 26, 2012

Livestats.XSP having trouble importing log files.

My company is running Livestats.XSP v8. We have been trying to import log files for a website for a few days now but Livestats keeps getting stuck randomly throughout the import process. What i mean by this is that i will import all of the log files by date which have been imported, then its stop and displays "Not Imported....."

We really need to get this remedied as soon as possible and it seems that support for Livestats is slim. Does anyone any idea that could help me? Thanks in advance.

Guess this is a application related problem which either should be answered through the support of the vendor or the support forums for the application.


Jens K. Suessmeyer.

-
http://www.sqlserver2005.de
-