Click here to Skip to main content
14,325,629 members
Rate this:
Please Sign up or sign in to vote.
See more:
I am Writing the below said code in vb.net 2008 Windows App.

Private Sub ExpTrk()
Try
Dim FNtrk As String
FNtrk = txtReptrkfile.Text

If dmlobj.con.State = ConnectionState.Closed Then
dmlobj.con.Open()

Dim sqltrkf As String = "Select Truck_No, Report_No,Rep_Date,Initial from NAGCM.dbo.RecTruck Where Report_No='" & txtrepno.Text & "' "

Dim datrkf = New SqlDataAdapter(sqltrkf, dmlobj.con)
Dim dstrkf As DataSet = New DataSet
datrkf.Fill(dstrkf, "RecTruck")
dstrkf.WriteXml("D:\ExpData\ '" & FNtrk & "'.xml")


MsgBox("Data Exported , MsgBoxStyle.Information, "Data Export")
dmlobj.con.Close()
End If
Catch ex As Exception
MsgBox(ex.Message.ToString)
End Try
End Sub
========

Now the problem is when i execute this code i get the xml file with name of txtReptrkfile.Text
With Double quotes for Example
The Textbox value is like 11180
Then i get the filename = '11180'

I want to remove these quotes

Any Help will be highly appreciated

Thanks in Advance
Posted

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Remove quotes from this line - dstrkf.WriteXml("D:\ExpData\ '" & FNtrk & "'.xml").
Change it to dstrkf.WriteXml("D:\ExpData\" & FNtrk & ".xml").
   
Comments
gufran90 10-Feb-12 4:35am
   
Thanks Mr. Abhinav

You are ow some

Its working. Great
Espen Harlinn 11-Feb-12 5:20am
   
5'ed!
Abhinav S 11-Feb-12 8:40am
   
Thank you Espen.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100