Showing posts with label format. Show all posts
Showing posts with label format. Show all posts

Saturday, March 31, 2012

The best file format to import/export data into sql database through asp.net application

Hi,

We are developing a SQL server based asp.net application. As part of
requirement we should allow users import/export some relational data through
web user interface. We are investigation which file format would be the most
efficient format to import export relational data.

So far we came up with two options: XML and Access MDB files and we prefer
MDB files.

Is there any better file format for import/export data?

Any help would be appreciated,
MaxThe format is not part of the requirements ? What is the exact purpose ?

IMO users are more used to spreadsheet files rather than to xml or even
Access files. Of course it depends if the overall goal is to import/export
data to automated systems or if this is to allows users to handle those
files by themselves in a familiar tool...

My personal default preference would be likely Excel files but your berst
bet is liekly to ask them what they intend to do with those files...

--
Patrice

"Max2006" <alanalan1@dotnet.itags.org.newsgroup.nospama crit dans le message de news:
OtaUPQpCIHA.464@dotnet.itags.org.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

Hi,
>
We are developing a SQL server based asp.net application. As part of
requirement we should allow users import/export some relational data
through web user interface. We are investigation which file format would
be the most efficient format to import export relational data.
>
So far we came up with two options: XML and Access MDB files and we prefer
MDB files.
>
Is there any better file format for import/export data?
>
Any help would be appreciated,
Max
>
>
>


CSV is what I would pick.

"Max2006" <alanalan1@dotnet.itags.org.newsgroup.nospamwrote in message
news:OtaUPQpCIHA.464@dotnet.itags.org.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

Hi,
>
We are developing a SQL server based asp.net application. As part of
requirement we should allow users import/export some relational data
through web user interface. We are investigation which file format would
be the most efficient format to import export relational data.
>
So far we came up with two options: XML and Access MDB files and we prefer
MDB files.
>
Is there any better file format for import/export data?
>
Any help would be appreciated,
Max
>
>
>


I see nothing wrong with MDB as asp.net has a data provider for it. You can
read it directly into SQL Server using dataset, I would think.

David
"Max2006" <alanalan1@dotnet.itags.org.newsgroup.nospamwrote in message
news:OtaUPQpCIHA.464@dotnet.itags.org.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

Hi,
>
We are developing a SQL server based asp.net application. As part of
requirement we should allow users import/export some relational data
through web user interface. We are investigation which file format would
be the most efficient format to import export relational data.
>
So far we came up with two options: XML and Access MDB files and we prefer
MDB files.
>
Is there any better file format for import/export data?
>
Any help would be appreciated,
Max
>
>
>


CSV (Comma Separated Values) is generally considered to be the most
platform-agnostic file format.
-- Peter
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com
"Max2006" wrote:

Quote:

Originally Posted by

Hi,
>
We are developing a SQL server based asp.net application. As part of
requirement we should allow users import/export some relational data through
web user interface. We are investigation which file format would be the most
efficient format to import export relational data.
>
So far we came up with two options: XML and Access MDB files and we prefer
MDB files.
>
Is there any better file format for import/export data?
>
Any help would be appreciated,
Max
>
>
>
>

Monday, March 26, 2012

The conversion of a char data type to a datetime data type resulted in an out-of-range dat

getting this error - i think its because im trying to put english date
format into american date format
(asp to sql server 2000)

im getting the date using
mortsourcedlabel.Text = Date.Today
mortsourcedlabel.Visible = True
mortsourced.Visible = False

which throws the date out (in uk format) to 13/02/2004 - all well and good
but -
im assuming that its going out of range as sql needs 02/13/2004
heh im guessing ive been testing code the past 2 weeks -- and now its the
13th which has now thrown up the error!
how do i change the date format not in the code above (i still need to see
the date in english-UK format on the page) but before the sql statement
(maybe in my stored procedure?)
thanks

marknm i sussed it with :-

Dim msl As String = mortsourcedlabel.Text.ToString ' date
Dim day, month, year As String
If mortsourcedlabel.Text.ToString = "" Then
msl = "01/01/1900"
Else
Dim mydate As Date
mydate = mortsourcedlabel.Text.ToString
day = mydate.Day.ToString
month = mydate.Month.ToString
year = mydate.Year.ToString
msl = month + "/" + day + "/" + year
End If

cheers

mark

Thursday, March 22, 2012

The format of the file Microsoft.Practices.EnterpriseLibrary.Data is invalid

I got this error when I moved my application to a new Windows 2003
server. I installed and recompiled the
'Microsoft.Practices.EnterpriseLibrary - June 2005" then added these
assemblies to the development machine's Assembly Cache. The assemblies
version appears to be 1.1.0.0. I changed the project reference to the
newly compiled EnterpriseLibrary DLLs. The Web.Config of my
application root, I also have the following <configSections>. I don't
know why at runtime it is still asking for
Microsoft.Practices.EnterpriseLibrary.Data, Version=1.0.0.0. Please
help. Thanks.

======================== My Web.Config (partial)
==========================
<configSections>
<section name="enterpriselibrary.configurationSettings"
type="Microsoft.Practices.EnterpriseLibrary.Configuratio n.ConfigurationManagerSectionHandler,

Microsoft.Practices.EnterpriseLibrary.Configuratio n,
Version=1.1.0.0,
Culture=neutral,
PublicKeyToken=60c24972b7c20af7" />
</configSections
<enterpriselibrary.configurationSettings
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
applicationName="DMS_ASPX"
xmlns="http://www.microsoft.com/practices/enterpriselibrary/08-31-2004/configuration">
<configurationSections>
<configurationSection xsi:type="ReadOnlyConfigurationSectionData"
name="dataConfiguration" encrypt="false">
<storageProvider xsi:type="XmlFileStorageProviderData"
name="XML File Storage Provider" path="dataConfiguration.config" />
<dataTransformer xsi:type="XmlSerializerTransformerData"
name="Xml Serializer Transformer">
<includeTypes />
</dataTransformer>
</configurationSection>
</configurationSections>
<keyAlgorithmStorageProvider xsi:nil="true" />
<includeTypes />
</enterpriselibrary.configurationSettings
========================= Runtime Error =========================
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.BadImageFormatException: The format of the
file 'Microsoft.Practices.EnterpriseLibrary.Data' is invalid.

Source Error:

[No relevant source lines]

Source File: c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Tempo rary
ASP.NET Files\root\88f31b66\ffb9ac8b\x-56vhi4.0.cs Line: 0

Assembly Load Trace: The following information can be helpful to
determine why the assembly 'Microsoft.Practices.EnterpriseLibrary.Data'
could not be loaded.

=== Pre-bind state information ===
LOG: DisplayName = Microsoft.Practices.EnterpriseLibrary.Data,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=60c24972b7c20af7
(Fully-specified)
LOG: Appbase = file:///C:/Inetpub/DMS_Net
LOG: Initial PrivatePath = bin
Calling assembly : DMS_ASPX, Version=0.0.0.0, Culture=neutral,
PublicKeyToken=null.
===

LOG: Publisher policy file is not found.
LOG: No redirect found in host configuration file
(c:\windows\microsoft.net\framework\v1.1.4322\aspn et.config).
LOG: Using machine configuration file from
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\confi g\machine.config.
LOG: Post-policy reference: Microsoft.Practices.EnterpriseLibrary.Data,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=60c24972b7c20af7
LOG: Attempting download of new URL
file:///c:/windows/microsoft.net/framework/v1.1.4322/Temporary ASP.NET
Files/root/88f31b66/ffb9ac8b/Microsoft.Practices.EnterpriseLibrary.Data.DLL.
LOG: Attempting download of new URL
file:///c:/windows/microsoft.net/framework/v1.1.4322/Temporary ASP.NET
Files/root/88f31b66/ffb9ac8b/Microsoft.Practices.EnterpriseLibrary.Data/Microsoft.Practices.EnterpriseLibrary.Data.DLL.
LOG: Attempting download of new URL
file:///C:/Inetpub/DMS_Net/bin/Microsoft.Practices.EnterpriseLibrary.Data.DLL.

Stack Trace:

[BadImageFormatException: The format of the file
'Microsoft.Practices.EnterpriseLibrary.Data' is invalid.]
DMS_ASPX.Helper.DataBroker..ctor() +0
DMS_ASPX.form.main..ctor() +53
ASP.main_aspx..ctor() in
c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Tempo rary ASP.NET
Files\root\88f31b66\ffb9ac8b\x-56vhi4.0.cs:0

[TargetInvocationException: Exception has been thrown by the target of
an invocation.]
System.RuntimeType.CreateInstanceImpl(Boolean publicOnly) +0
System.Activator.CreateInstance(Type type, Boolean nonPublic) +66
System.Web.UI.TemplateControlParser.GetCompiledIns tance(String
virtualPath, String inputFile, HttpContext context) +164

[HttpException (0x80004005): Failed to create page of type
'ASP.main_aspx'.]
System.Web.UI.TemplateControlParser.GetCompiledIns tance(String
virtualPath, String inputFile, HttpContext context) +341
System.Web.UI.PageParser.GetCompiledPageInstanceIn ternal(String
virtualPath, String inputFile, HttpContext context) +43
System.Web.UI.PageHandlerFactory.GetHandler(HttpCo ntext context,
String requestType, String url, String path) +44
System.Web.HttpApplication.MapHttpHandler(HttpCont ext context,
String requestType, String path, String pathTranslated, Boolean
useAppConfig) +699

System.Web.MapHandlerExecutionStep.System.Web.Http Application+IExecutionStep.Execute()
+95
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
completedSynchronously) +173

------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2300;
ASP.NET Version:1.1.4322.2300Ok. I solved this problem myself. It turns out that the Enterprise
Library Configuration utility created two .config files in the
application root:

web.config
dataconfiguration.config

I changed the reference version in both of the config file to the
correct version.
Ok. I solved this problem myself. It turns out that the Enterprise
Library Configuration utility created two .config files in the
application root:

web.config
dataconfiguration.config

I changed the reference version in both of the config file to the
correct version.

The given paths format is not supported??

Can anyone explain to me why this works...

string Email_Loc; //Stores the emails full path.
TextReader Msg_Reader = File.OpenText(Email_Loc);
Email_Msg = Msg_Reader.ReadLine();
Msg_Reader.Close();

but this
string Email_Loc; //Stores the emails full path.
TextReader Msg_Reader = File.OpenText(Email_Loc);
Email_Msg = Msg_Reader.ReadToEnd();
Msg_Reader.Close();
or this does not??

string Email_Loc = ""; //Stores the emails full path.
TextReader Msg_Reader = File.OpenText(Email_Loc);
while(Msg_Reader.ReadLine() != null)
{
Email_Msg += Msg_Reader.ReadLine();
}
Msg_Reader.Close();
I need to be able to read the entire file but when I try ether of the second two code blocks I get the following error.
System.NotSupportedException: The given path's format is not supported.
at System.Security.Util.StringExpressionSet.CanonicalizePath(String path, Boolean needFullPath)
at System.Security.Util.StringExpressionSet.AddExpressions(String[] str, Boolean checkForDuplicates, Boolean needFullPath)
at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
at System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, String[] pathList, Boolean checkForDuplicates, Boolean needFullPath)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
at System.IO.StreamWriter.CreateFile(String path, Boolean append)
at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize)
at System.IO.StreamWriter..ctor(String path)
at SpamCenturion.MainClass.scanMessage(String Current_Msg, String Msg_Path)Where does Email_Loc get set? It does not appear to be set correctly in any of your examples.

Thanks for the replyDouglas.
I'm actually setting it higher up, but fortunately I figured out that it was just a simple oversight on my part.
A few lines further down I'm calling a method that actually wrote back to the file.
The only problem was that I was passing the file path to it twice.
And so the error "The given path's format is not supported".
I hadn't made it that far down in my debugging because it seemed that the code was failing at this point.
Sorry to waste your time.
Thanks again for the quick response.