SQL 2005 PROBLEM - Fairly Urgent

Feb 12, 2006

Hi there,

I am about to deploy an application and it works fine when launched from vwd... but typing it as locahost/application/example.aspx produces.....


Server Error in '/WiseSystem' Application.

Unable
to open the physical file
"C:InetpubwwwrootWiseSystemApp_DataDatabase.mdf". Operating system
error 32: "32(error not found)".
An attempt to attach an auto-named
database for file C:InetpubwwwrootWiseSystemApp_DataDatabase.mdf
failed. A database with the same name exists, or specified file cannot
be opened, or it is located on UNC share.



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.Data.SqlClient.SqlException:
Unable to open the physical file
"C:InetpubwwwrootWiseSystemApp_DataDatabase.mdf". Operating system
error 32: "32(error not found)".
An attempt to attach an auto-named
database for file C:InetpubwwwrootWiseSystemApp_DataDatabase.mdf
failed. A database with the same name exists, or specified file cannot
be opened, or it is located on UNC share.

Does anyone know why this is?? I havent used SQL servers before and this is the first real application i have designed.

Please help!!

View 2 Replies


ADVERTISEMENT

Fairly Basic Question, I Think

May 28, 2008

I have a table with rate histories that we recieve three times a day. I want to write a query that returns all fields for the row with the latest receipt time. ie - we get rates at 10 AM, 1 PM and 4 PM and I want to return the row from 4 PM. The arrival time is stored down to the seconds so I can't set an exact critera. I'm trying to so something like this...

Select *
from ratehistory
where ratehistoryid in (Select ratehistoryid, max(reciept) from ratehistory group by Cusip, Date(reciept))

Mike Devenney

View 7 Replies View Related

A Fairly Simple Select Problem

Jun 11, 2008

I want to select from a table based of a variable, the variable is either 1 or 2, however is it possible to ask for BOTH 1 and 2 when calling from a variable?I tried this, but it seems to only look for values matching 1 and then stop... SET @FuelType = '1 OR FuelType = 2'SELECT * FROM Engine WHERE  FuelType = @FuelType 

View 6 Replies View Related

Querying Through Multiple Tables? Fairly New And Stuck!

Jan 4, 2004

I am trying to query multiple tables that have the same column. They are a supposed to be a unique ID to the product, but not to the database. I have a primary key already set to each othe tables. The tables do not share anything between them, but i would like to search for these IDs in other tables before my insert command is executed. I am writing my code in VB. example of what i am trying to accomplish.
Table1 = TVs
ID/SKU_ID/Manufacturer
1 87654 Samsung

Table2 = DVD_Players
ID/SKU_ID/Manufacturer
2 765234 Kenwood

I want to search for SKU_ID in multiple tables( I think a total of 9 tables). I want to search between tables to catch for the same SKU_IDs. and if it finds it, raise error. I will be able to figure the vb.net portion. I just dont know how to go about the sql query portion. Thanks in advance and appreciate any help. Thanks!

View 2 Replies View Related

Help, Fairly Complicated File Parsing Issue

Jun 7, 2007

Hi,



I have a situation where I'm having to extract key data from a financial file. Problem is, the columns are not nice and tidy.



Basically the file looks like this:



row 1: "788","Company","OPENING BALANCE:", 2084587.76
row 2: "313947","04/01/07","3","CS","FF", 170.00,"AZT","XYC INC", 20.8, 351.00
row 3:"788","06/06/07 CLOSING BALANCE:", 206203893.03



So, I'm going to need to get the OPENING BALANCE and CLOSING BALANCE figures, as well as all the data in between, ie) row 2 through n.



Does anyone have an example of a script that can be used for extracting very specific values from a file?



I have a script that checks for incomplete rows, but it is not sophisticated enough for this situation.



Thanks much




View 9 Replies View Related

SQL 2000 V 2005 - URGENT, PLEASE HELP!

Oct 26, 2007

Hi, I have recently qualified as a MCITP - DBA with SQL 2005, but as I have no commercial experience, have been strugglling to get into the industry. However, I have finally been offered an interview on Monday. The problem is that the company use 2000, not 2005. I think I am pretty much up to speed on the differences, but was wondering (nay, pleading) if anybody could let me know the main commands for analysing query performance and index statistics etc, with a reference to thier equivalent DMV in 2005 (which I am totaly familiar with) This is something I could easily pick up whilst doing the job, but I am aware that there will be an SQL test to asses my knowledge during the interview and I am desperate not to get caught out. Please help!

View 2 Replies View Related

Error During SQL 2005 Instalation - Urgent

Nov 26, 2007

Hi Gurus,

I have a Windows Server 2003 with SQL Server 2000, and I tryng to upgrading this version to SQL Server 2005 but when I start the setup file a received a big log error:

Microsoft SQL Server 2005 Setup beginning at Mon Nov 26 11:47:08 2007
Process ID : 2332
E:Tempsqlcd1setup.exe Version: 2005.90.1399.0
Running: LoadResourcesAction at: 2007/10/26 11:47:8
Complete: LoadResourcesAction at: 2007/10/26 11:47:8, returned true
Running: ParseBootstrapOptionsAction at: 2007/10/26 11:47:8
Loaded DLL:E:Tempsqlcd1xmlrw.dll Version:2.0.3604.0
Complete: ParseBootstrapOptionsAction at: 2007/10/26 11:47:8, returned false
Error: Action "ParseBootstrapOptionsAction" failed during execution. Error information reported during run:
Could not parse command line due to datastore exception.
Source File Name: utillibpersisthelpers.cpp
Compiler Timestamp: Fri Jul 29 01:13:55 2005
Function Name: writeEncryptedString
Source Line Number: 124
----------------------------------------------------------
writeEncryptedString() failed
Source File Name: utillibpersisthelpers.cpp
Compiler Timestamp: Fri Jul 29 01:13:55 2005
Function Name: writeEncryptedString
Source Line Number: 123
----------------------------------------------------------
Error Code: -1073741766
Windows Error Text: Source File Name: cryptohelpercryptsameusersamemachine.cpp
Compiler Timestamp: Mon Jun 13 14:30:00 2005
Function Name: sqls::CryptSameUserSameMachine::ProtectData
Source Line Number: 50

3221225530
Could not skip Component update due to datastore exception.
Source File Name: datastorecachedpropertycollection.cpp
Compiler Timestamp: Fri Jul 29 01:13:49 2005
Function Name: CachedPropertyCollection::findProperty
Source Line Number: 130
----------------------------------------------------------
Failed to find property "InstallMediaPath" {"SetupBootstrapOptionsScope", "", "2332"} in cache
Source File Name: datastorepropertycollection.cpp
Compiler Timestamp: Fri Jul 29 01:13:50 2005
Function Name: SetupBootstrapOptionsScope.InstallMediaPath
Source Line Number: 44
----------------------------------------------------------
No collector registered for scope: "SetupBootstrapOptionsScope"
Running: ValidateWinNTAction at: 2007/10/26 11:47:8
Complete: ValidateWinNTAction at: 2007/10/26 11:47:8, returned true
Running: ValidateMinOSAction at: 2007/10/26 11:47:8
Complete: ValidateMinOSAction at: 2007/10/26 11:47:8, returned true
Running: PerformSCCAction at: 2007/10/26 11:47:8
Complete: PerformSCCAction at: 2007/10/26 11:47:8, returned true
Running: ActivateLoggingAction at: 2007/10/26 11:47:8
Error: Action "ActivateLoggingAction" threw an exception during execution. Error information reported during run:
Datastore exception while trying to write logging properties.
Source File Name: datastorecachedpropertycollection.cpp
Compiler Timestamp: Fri Jul 29 01:13:49 2005
Function Name: CachedPropertyCollection::findProperty
Source Line Number: 130
----------------------------------------------------------
Failed to find property "primaryLogFiles" {"SetupStateScope", "", ""} in cache
Source File Name: datastorepropertycollection.cpp
Compiler Timestamp: Fri Jul 29 01:13:50 2005
Function Name: SetupStateScope.primaryLogFiles
Source Line Number: 44
----------------------------------------------------------
No collector registered for scope: "SetupStateScope"
00DCCFC8Unable to proceed with setup, there was a command line parsing error. : 2
Error Code: 0x80070002 (2)
Windows Error Text: The system cannot find the file specified.

Source File Name: datastorepropertycollection.cpp
Compiler Timestamp: Fri Jul 29 01:13:50 2005
Function Name: SetupBootstrapOptionsScope.InstallMediaPath
Source Line Number: 44

Class not registered.
Failed to create CAB file due to datastore exception
Source File Name: datastorecachedpropertycollection.cpp
Compiler Timestamp: Fri Jul 29 01:13:49 2005
Function Name: CachedPropertyCollection::findProperty
Source Line Number: 130
----------------------------------------------------------
Failed to find property "HostSetup" {"SetupBootstrapOptionsScope", "", "2332"} in cache
Source File Name: datastorepropertycollection.cpp
Compiler Timestamp: Fri Jul 29 01:13:50 2005
Function Name: SetupBootstrapOptionsScope.HostSetup
Source Line Number: 44
----------------------------------------------------------
No collector registered for scope: "SetupBootstrapOptionsScope"
Message pump returning: 2

View 2 Replies View Related

URGENT: SQL 2005 : All Schedulers Appear Deadlocked

May 30, 2006

Hi All,

please throw in any ideas as it matter of urgency.

We have rebuild our 24/7 heavy loaded website using ASP.NET 2.0 and SQL 2005 (we have one active-passive cluster for main activity and 2 active-active clusters to browse static data).

Main cluster is publisher and distributor for replication of data (small subset of it and it works fine).

Hardware is pretty tough - 16 zeons 32G ram, NetApp SAN.

We had no troubles in first 3 days but now it gives us some headache.

Yesterday it failed and website was unavailable for about 5 min. Today happened the same.

SQL Server rebooted - no failover occured - just rebooted on the same physical box as it was before.

The first message I can see :

All schedulers on Node 0 appear deadlocked due to a large number of worker threads waiting on LCK_M_IS. Process Utilization 0%%.

We didnt have any significant lock issues before and havent been expecting them. Yesterday db failed in the morning - which is not a peak time.

Is anyone can advise on what I have to do to find out the real source of the problem. Is it the same for both incidents ?



P.S. We have 3d party monitoring our db and also we have NetApp software doing Snapshot backups on the SAN.

View 8 Replies View Related

URGENT.. REPLICATE FROM SQL 2005 TO INFORMIX 10

Nov 7, 2005

Hi.

View 1 Replies View Related

URGENT HELP PLS + FREETEXT + SQL SERVER 2005

Dec 10, 2007



Hi

I was looking at this link : http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=792720&SiteID=17&pageid=0

I am using SQL SERVER 2005.

I have noiseeng.txt and noiseenu.txt.

I have stopped all the MSSQLSERVER, MSSQLAGENT,BROWSER, EXPRESS and FULL SEARCH.

Then I removed all the numbers from the noiseeng.txt and noiseenu.txt.

I restarted the services again.

I tried to run this query


DECLARE @SearchWord nvarchar(30);

SET @SearchWord = 'MS';

SELECT ProductDescription

FROM Products

WHERE FREETEXT(ProductDescription, @SearchWord);

I can't seem to get any records out and it won't pick the two that I am actually looking for.

In the Products table, it has several rows containing:
MS1234
MS_1234
MS-1234
MS 1234
MS/1234


I am trying to retrieve the above records using just 'MS', but it just doesn't work at all.

Any suggestions, help or examples please - would be most appreciated.

Thanks

Newbie

View 4 Replies View Related

Urgent, Dot Net 2005 Cannot Connect To SQL Server 2000

Oct 19, 2007

I am using VS .net 2005 to  develop a web application with sql server 2000, but the SQL servrer 2000 is setup on other computer,so, my web server is setup on A machine and SQL servr is setup on B machine.I got a problem when i try to connect to SQL server through the Web form as following error."An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"
I had try to  setup the MDAC 2.8 on my Web Server, but i got a setup error sth like "MDAC 2.8 cannot install on your machine because it is not support your windows version.........."
Why i can't connect to SQL 2000 through the Web server??? 
It is a urgent case, Please help thx a lot.

View 3 Replies View Related

Urgent:Problem In SQL Server Express 2005

Jan 10, 2006

Hi all,
My problem may seem simple but i just can't figure it out as it is very new area for me. Could some one help out as this is urgent. The problem is:SQL Server(SQLEXPRESS) is stopped. I'm not able to start the service. The error was:"The request failed or theservice did not respond in a timely fashion. Consult the event log or other applicable error logs for details".
Any help appreciated. Thanks in Advance.

View 3 Replies View Related

URGENT - Link Server 2005 To 2000

Jul 18, 2006

I've a database in 2000 which needs to be accessed from 2005 via linkedserver. I've tried the GUI options and it is failing. One thins is that ourboth servers have hyphen('-' not underscore, could that be a problem) in thenames, like 2k-srv and 2k5-srv as hosts, but the instances are default.Can anyone give me the steps please.TIANasir

View 4 Replies View Related

URGENT:How To Store And Retrive Images From SQL SERVEr 2005 In Asp.net 2.0

Jul 2, 2006

 i am working on a uni project based on orkut and is having dfficulty in storing and retrieving images..
can anybody please guide me...
thanx
 

View 1 Replies View Related

SQL Server 2005 Express Error. URGENT HELP NEEDED!

Jun 5, 2006

I get the following error when I try to access the database from my web application
Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.
The application works when I run it on my local machine, but when I move the application to a remote server, I get the above error.
Below is the connection string section in my web.config file.
 <connectionStrings>  <remove name="LocalSqlServer"/>  <add name="LocalSqlServer"        connectionString="Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|CiaaASPNETDB.MDF;user instance=true;Integrated Security=True;Initial Catalog=CiaaASPNETDB;Integrated Security=True;user instance=true;Connection Timeout = 0"       providerName="System.Data.SqlClient"/>  <!--Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|CiaaASPNETDB.MDF;user instance=true;Integrated Security=True;Initial Catalog=CiaaASPNETDB --> </connectionStrings>
Can anyone help me with this.

View 1 Replies View Related

Urgent : Sql Server Data Trnsfer From 2000 To 2005

May 31, 2008

Hi there,

I got a shared web hosting server with sql server db which is 2k, and now ive got dedicated with godaddy where i installed sql 2005 express edition, now my shared hosting ppl gave me db bkup which i cant restore , so i copied all data from asp.net web based enterprise manager into an excel sheet and am trying to copy that data into sql2005 management studio express, however it doesnt let me do that.

I am trying to use openrowset, but my knowledge in sql is minimal so cant run that either.

can you please please please tell me how to do this asap, its very urgent as my contract runs out with shared hosting on 31 and ive to switch this site live by tomorrow.

please let me know asap wat to do, i can pay also for this job?

amit
amitsharma1977@gmail.com

View 7 Replies View Related

URGENT! -SQL Server 2005 Express Advanced Features

Nov 19, 2007

Hi,

I wish to know that whether SQL Server 2005 Express Edition ables to integrate with DTS and analysis Manager?
Thank you very much.

Regards,
Chong

View 2 Replies View Related

SQL Server 2005 EXPRESS Advanced Features - URGENT

Nov 20, 2007

Hi,
Can anyone tell me is it possible for SQL Server 2005 Express Edition to open DTS and Analysis Manager?
thanks.

View 1 Replies View Related

(Urgent) How To Transfer Data From Sqlserver 2000 To 2005

Jan 4, 2008



Hi,

I am trying to transfer data from a sql server 2000 database to a Sql Server 2005 database... and i just want to transfer around 2 tables.. and my sql server 2000 database is located in one machine and the 2005 database is located in the other machine.. So i am trying to insert data into the sql server 2005 database. So can i do it like this..

Insert into SqlServer2005comp.Databasename..TableName

(

Columns

)

Select

Columns

From

sqlserver2000comp.Databasename..tablenames

Where UserId = @UserId.

Is this the right way to do it.. and can i give this query in the sqlserver2005 db or the 2000 db

any help or ideas will be appreciated.

Regards...

Karen

View 7 Replies View Related

Timeout Expired -- URGENT, URGENT, URGENT!!!

Sep 27, 2000

This morning I can not connect to our SQL Server 7.0 whatever from client or server. The error message which I list below:

++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++
A connection could not be estabished to server--Timeout expired
Please verfy SQL Server is running and check your SQL Server registration properties and try again.
++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++

We use windows NT authentication. We did not do any change on NT. The SQL Server daily schedule job usally stoped at 10:00AM, but today from the Window NT Task Manager, we can see that the SQL Server is still running untill now.

Please help!!!

View 3 Replies View Related

Urgent - Analysis Service Install On An Existing Sql 2005 Cluster - Please Help

Nov 2, 2007

Hi,

I am having an existing sql 2005 cluster on an active passive cluster. I need to add analysis service to this as a new component. I am having enough space available in the cluster disks. Following are my queries,

1) do i need a new virtual ip and virtual server name for the analysis services ?

2) do i need a seperate cluster resource group for analysis services with an additional disk added ?

Regards
Nimesh

View 1 Replies View Related

(Urgent)web Service And Sql Server 2005 Database Running In Two Different Systems

Apr 26, 2006

hi all,

i have a requirement that web service running in one system and sql server 2005 database running in another systems which is not working currently.

suppose i create end point in the system where sql server 2005 database is there,then its working fine.

Actually for creating end point we should have windows server 2003 or SP2.Configuration part i dont have any hindrance.

Can any one tell how to run webservice in one system with sql server 2005 in another system.

Thanks

venkat





View 2 Replies View Related

URGENT::Oracle To SQL 2005 Replication ( Drop Coulmn From Publication)

Jul 9, 2007



I'm in a middle of a project where replication established between Oracle 8i and SQL server 2005. Now we need to drop one column from on of the tables replicated from Oracle side. My question : Is there anyway I can do this in Oracle and automatically reflected on SQL server? If not what is the proper steps to do it. Realy appreciate your fast response.



Regards

View 1 Replies View Related

URGENT: Windows X64, SQL 2005, ODBC - Setting Default Provider For A System DSN

Jan 6, 2006

In Windows Server 2003 SP1 (x86) with Sql Server 2000 I could use the following connectionstring no problem
DSN=Hello;

Now I am using Windows Server 2003 x64 and SQL 2005 and I get this error:
Provider is not specified and there is no designated default provider.

If i try Provider=MSDASQL;DSN=Hello; i get
Provider cannot be found. It may not be properly installed.

for DSNless this works fine:
Provider=sqloledb;driver={sql server};server=(local);database=Hello;uid=sa;pwd=p wd;

but i am forced to use DSN as it is in a closed source application which uses set DSNs (the idea there being that you can change the connections how you like in ODBC)

This means that i need the ODBC provider name that will work in here: Provider=...;DSN=Hello;

and then to use whatever works in there as the "default provider" but i cannot find any information anywhere on how to do this!

please reply ASAP!

View 7 Replies View Related

URGENT: Problems With Guest User In SQL 2005 Restoring Databases From Sql 2000

Sep 18, 2006

Hi all.

I don't know if this is the right forum to post this question, but here it goes.

We have restored into sql 2005 the database backups made in sql 2000. We connect with trusted connection and application roles, and when trying to execute a transaction to another database (with the guest user), we get a permission error.

Does anyone know if, apart from restoring the databases, we should do something else to get the guest user working the same way as with sql 2000 in the restored databases?

Thanks in advance for your help.




View 1 Replies View Related

How To Encrypt My Password Or Sensitive Data Before Storing Them In A Database , Using SQL Server 2005?[urgent Plz Help]

Jan 7, 2007

Hi there ,1. i have a database and i want to encrypt my passwords before storing my records in a database plus i will later on would require to  authenticate my user so again i have to encrypt the string provided by him to compare it with my encrypted password in database below is my code , i dont know how to do it , plz help 2. one thing more i am storing IP addresses of my users as a "varchar" is there a better method to do it , if yes plz help me    try        {            SqlConnection myConnection = new SqlConnection();            myConnection.ConnectionString = ConfigurationManager.ConnectionStrings["projectConnectionString"].ConnectionString;            SqlDataAdapter myAdapter = new SqlDataAdapter("SELECT *From User_Info", myConnection);            SqlCommandBuilder builder = new SqlCommandBuilder(myAdapter);            DataSet myDataset = new DataSet();            myAdapter.Fill(myDataset, "User_Info");            //Adding New Row in User_Info Table               DataRow myRow = myDataset.Tables["User_Info"].NewRow();            myRow["user_name"] = this.user_name.Text;            myRow["password"] = this.password.Text; // shoule be encrypted             //not known till now how to do it                       myRow["name"] = this.name.Text;            myRow["ip_address"] = this.ip_address.Text;                        myDataset.Tables["User_Info"].Rows.Add(myRow);            myAdapter.Update(myDataset, "User_Info");            myConnection.Close();            myConnection.Dispose();        }        catch (Exception ex)        {            this.error.Text = "Error ocurred in Creating User : " + ex.Message;        }  

View 3 Replies View Related

URGENT.Sql Server Does Not Recognise MAPI , Or Profile Name URGENT

Oct 26, 2000

hi, I have settup up sql mail and did the following:
1. created an E-mail account and configured Out look by creating a pop3 mail profile. tested it by sending and receiving mail, that is ook
2. I Created one domain account for MSsqlserver and Sql Agent service. both services use same account and start automatically in the control panel-services
3. I used the profile that I created in outlook to test the sql mail but got an error:
Error 22030 : A MAPI error ( error number:273) occurred: MapiLogon Ex Failed due to MAPI
Error 273: MAPI Logon Failed

I really do not know what went wrong. I followed the steps from bol and still having a problem. Am I missing something.

I do have a valid email account
I do have a valid domain account
I tested outlook using the email account and it worked. so why sql server does not recognise MAPI.

My next question, How to configure MAPI in Sql server if what I did was wrong.

View 1 Replies View Related

Urgent, Urgent !! My Sql Server Refused To Start Due To Encrypton

Mar 23, 2001

Hi, I have 2 windows 2000 server in cluster with sql server 2000 enterprise edition installed.
I have activated the Server-Requested Encryption by using the sql server network utility (Force Protocol Encryption). After this, I have stoped sql server service. But I can't start it at this moment.
The error is:
19015: The encrypton is required but no available certificat has been found.

Please help me to start sql server.

Thanks.

Michel

View 4 Replies View Related

Urgent Urgent Please.(Access SQL Pass Through Queries)

Jul 6, 2000

Hello,
I am facing a huge problem in my sql server database using access as a front end.The main problem is trying to execute queries "views" ,since they reside on sql server now,and using variables or parameters in reports and forms to filter on this query.
Ex.
how can the following be implemented using the same query but in sql server?
Access
------
SELECT MAT_Charts.YYYYMM
FROM MAT_Charts
WHERE ((([Area_Code] & "-" & [GROUP_CODE])=[Reports]![MAT_Chart_C1].[MAT_Key]))
GROUP BY MAT_Charts.YYYYMM;

It is specifically this statement in which I am interested:
[GROUP_CODE])=[Reports]![MAT_Chart_C1].[MAT_Key]))

Thank you very much for your concern.

View 2 Replies View Related

Scheduling(URGENT... URGENT)

Dec 20, 2000

Hi everybody,

I have a batch which needs to be run every day night at 2:00 am.I Using At command but it is not working. if u have idea, please let me know

I AM USING THE FOLLOWING COMMAND :
AT 2:00AM C:SCHED.BAT

Thanks in advance
Krishna

View 3 Replies View Related

Urgent Really Urgent Dbcc

Apr 19, 2008

hi all
its urgent really urgent
please reply soon

I am getting error in sysindexes when i run dbcc checkdb on a production db.
the error is Server: Msg 8928, Level 16, State 1, Line 1
please help me to remove this
all the options of dbcc checkdb as well as table are not helping me


thanks in advance

View 4 Replies View Related

Urgent Help Please

Feb 25, 2007

Hi Guys
i write a thread before asking for help with reading an uploaded csv file,
i have my code, it reads the csv file and currently displays it in a datagrid but what i actually want is to take the read information and import it into my sql express db.
Heres the code<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
If (IsPostBack) Then
Grid1.Visible = True
Else
Grid1.Visible = False
End If
End Sub
Sub UploadButton_Click(ByVal sender As Object, ByVal e As System.EventArgs)
'Save the uploaded file to an "Uploads" directory
' that already exists in the file system of the
' currently executing ASP.NET application.
' Creating an "Uploads" directory isolates uploaded
' files in a separate directory. This helps prevent
' users from overwriting existing application files by
' uploading files with names like "Web.config".
Dim saveDir As String = "Data"

' Get the physical file system path for the currently
' executing application.
Dim appPath As String = Request.PhysicalApplicationPath

' Before attempting to save the file, verify
' that the FileUpload control contains a file.
If (FileUpload1.HasFile) Then
Dim savePath As String = appPath + saveDir + FileUpload1.FileName

' Call the SaveAs method to save the
' uploaded file to the specified path.
' This example does not perform all
' the necessary error checking.
' If a file with the same name
' already exists in the specified path,
' the uploaded file overwrites it.
FileUpload1.SaveAs(savePath)

' Notify the user that the file was uploaded successfully.
UploadStatusLabel.Text = "Your file was uploaded successfully."

Else
' Notify the user that a file was not uploaded.
UploadStatusLabel.Text = "You did not specify a file to upload."
End If

End Sub

Sub DisplayButton_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim sConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=C:inetpubwwwrootMerlinLocalPostOfficeAppData;Extended Properties=""text;HDR=NO;FMT=Delimited"""
Dim objConn As New OleDbConnection(sConnectionString)
objConn.Open()
Dim objCmdSelect As New OleDbCommand("SELECT * FROM csv.txt", objConn)
Dim objAdapter1 As New OleDbDataAdapter()
objAdapter1.SelectCommand = objCmdSelect
Dim objDataset1 As New DataSet()
objAdapter1.Fill(objDataset1, "csv.txt")
Grid1.DataSource = objDataset1.Tables(0).DefaultView
Grid1.DataBind()
objConn.Close()
End Sub


</script> 
My csv file does not have headers so the default value is F1, F2, F3 F4, F5,F6, F7, my database has  the following columns, ID,AddressLine1,AddressLine2,AddressLine3,AddressLine4,AddressLine5,AddressLine6,Postcode
I need to know how to import the information direct into the db rather than displaying it on the page, ive tried but im really new to this and cant get it to work.  I cant use DTS or bulk insert as the server this will go on doesnt have sql on it, the db is an MDF file so is transportable with the app.
Thanks for your help

View 3 Replies View Related

T-SQL URGENT URGENT URGENT

Nov 18, 2007

Hello
I'm trying to execute the following
INSERT INTO  @dbName.dbo.AP_TransMain SELECT * FROM Inserted WHERE Pay_Id=Inserted.Pay_Id
but its giving me an error becuase of @dbName which is a variable decleared as the followingDECLARE @dbName as varchar(100)
the Database name is assigned to @dbName
but i can't take the value of @dbName to combine it to the rest of the statment
INSERT INTO  @dbName.dbo.AP_TransMain SELECT * FROM Inserted WHERE Pay_Id=Inserted.Pay_Id
 
what should i do ! please help :(

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved