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 2008 Windows App.

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

If dmlobj.con.State = ConnectionState.Closed Then

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")
End If
Catch ex As Exception
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

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").
gufran90 10-Feb-12 4:35am
Thanks Mr. Abhinav

You are ow some

Its working. Great
Espen Harlinn 11-Feb-12 5:20am
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