File Systesm Object

G

Guest

I am using the following code and it works fine. Instead of hard coding the
location for saving the file I will like to use the file dialog box in
windows. So that the user and give a name to the file and also select a
location to save it in. I then would like to grab the path and file name
information and use that to save the dataset.

PLS help I will be forever grateful.

Thanks

(e-mail address removed)



Dim strSQL As String

strSQL = "SELECT top 200 ID, STATUS,LAST_FIRST ,COMPANY FROM Name"

Dim strConn As String

strConn = "User ID=ss;pwd = 123;Initial Catalog=IMIS_PRODUCTION;Data
Source=NEITESTDB"

Dim sqlconn As New SqlConnection(strConn)

sqlconn.Open()

Dim sqlDA As New SqlDataAdapter(strSQL, sqlconn)
Dim objds As New DataSet()

sqlDA.Fill(objds, "dtnames")
objds.WriteXml("c:\imis_web_test.xls")
dg1.DataSource = objds.Tables.Item("dtnames")
'dg1.PagerStyle.NextPageText = "Next"
'dg1.PagerStyle.PrevPageText = "Previous"
dg1.DataBind()
sqlconn.Close()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top