how to upload files to the Server path
-
M_SqlPathName = dsExecu.Tables(1).Rows(0)("AppSet_PhysicalPath") + Utilities.Dtgetsource.Rows(J)("FileDir") + Utilities.Dtgetsource.Rows(J)("FileName") Dim sqlcmdsql As New SqlCommand sqlcmdsql.Connection = sqlCon1 Dim fileInfo1 As FileInfo = New FileInfo(M_SqlPathName) --up to this line of code am getting the server path as D:\attachment\JON103\SQLQuery11.sql Dim script As String = fileInfo1.OpenText().ReadToEnd() --then in script am not getting any path so it throws null exceptional error SqlScript = script pls anyone chk this out and tell me how to get the server path and upload the excel file to it:confused::confused:
-
M_SqlPathName = dsExecu.Tables(1).Rows(0)("AppSet_PhysicalPath") + Utilities.Dtgetsource.Rows(J)("FileDir") + Utilities.Dtgetsource.Rows(J)("FileName") Dim sqlcmdsql As New SqlCommand sqlcmdsql.Connection = sqlCon1 Dim fileInfo1 As FileInfo = New FileInfo(M_SqlPathName) --up to this line of code am getting the server path as D:\attachment\JON103\SQLQuery11.sql Dim script As String = fileInfo1.OpenText().ReadToEnd() --then in script am not getting any path so it throws null exceptional error SqlScript = script pls anyone chk this out and tell me how to get the server path and upload the excel file to it:confused::confused:
-
If
D:\attachment\JON103\SQLQuery11.sql
does not exist,fileInfo1
will be null ('Nothing' in VB). Ensure that the file exists.modified on Monday, December 7, 2009 5:38 AM
Dim fileInfo1 As FileInfo = New FileInfo(M_SqlPathName) --up to this line of code am getting the server path as D:\attachment\JON103\SQLQuery11.sql Dim script As String = fileInfo1.OpenText().ReadToEnd() --then in script am not getting any path so it throws null exceptional error SqlScript = script in M_SqlPathName am getting the above directory root name, but in next stept script=fileInfo1.OpenText().ReadToEnd() it throws an error, object reference
-
Dim fileInfo1 As FileInfo = New FileInfo(M_SqlPathName) --up to this line of code am getting the server path as D:\attachment\JON103\SQLQuery11.sql Dim script As String = fileInfo1.OpenText().ReadToEnd() --then in script am not getting any path so it throws null exceptional error SqlScript = script in M_SqlPathName am getting the above directory root name, but in next stept script=fileInfo1.OpenText().ReadToEnd() it throws an error, object reference