Advertisement
| Hall of Fame |
|
[x]
Posted via EE Mobile
|
||
Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
||
| Question |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: |
If FileUpload1.HasFile Then
FileUpload1.PostedFile.SaveAs(Server.MapPath("/roster/temp/rosterimport.xls"))
'View in grid
'Dim objDataAdapter As New OleDbDataAdapter()
'objDataAdapter.SelectCommand = ExcelConnection()
'Dim objDataSet As New DataSet()
'objDataAdapter.Fill(objDataSet)
'GridView1.DataSource = objDataSet.Tables(0).DefaultView
'GridView1.DataBind()
'GridView1.Visible = True
'objDataAdapter.Dispose()
'objDataSet.Dispose()
Dim objDataAdapter As New OleDbDataAdapter()
objDataAdapter.SelectCommand = ExcelConnection()
Dim dsRosterUpdate As New DataSet()
objDataAdapter.Fill(dsRosterUpdate)
Dim i As Integer = 0
While i < dsRosterUpdate.Tables(0).Rows.Count
Dim RosterID As Integer = dsRosterUpdate.Tables(0).Rows(i)("id")
Dim FirstName As String = Convert.ToString(dsRosterUpdate.Tables(0).Rows(i)("first_name"))
Dim LastName As String = Convert.ToString(dsRosterUpdate.Tables(0).Rows(i)("last_name"))
Dim JobTitle As String = Convert.ToString(dsRosterUpdate.Tables(0).Rows(i)("job_title"))
Dim Department As String = Convert.ToString(dsRosterUpdate.Tables(0).Rows(i)("department"))
Dim Market As String = Convert.ToString(dsRosterUpdate.Tables(0).Rows(i)("market"))
Dim BusinessUnit As String = Convert.ToString(dsRosterUpdate.Tables(0).Rows(i)("business_unit"))
Dim Division As String = Convert.ToString(dsRosterUpdate.Tables(0).Rows(i)("division"))
Dim Email As String = Convert.ToString(dsRosterUpdate.Tables(0).Rows(i)("email"))
Dim Tel As String = Convert.ToString(dsRosterUpdate.Tables(0).Rows(i)("tel"))
Dim DirectTel As String = Convert.ToString(dsRosterUpdate.Tables(0).Rows(i)("direct_tel"))
Dim Fax As String = Convert.ToString(dsRosterUpdate.Tables(0).Rows(i)("fax"))
Dim Mobile As String = Convert.ToString(dsRosterUpdate.Tables(0).Rows(i)("mobile"))
Dim Address As String = Convert.ToString(dsRosterUpdate.Tables(0).Rows(i)("address"))
Dim Assistant As String = Convert.ToString(dsRosterUpdate.Tables(0).Rows(i)("assistant"))
Dim AssistantTel As String = Convert.ToString(dsRosterUpdate.Tables(0).Rows(i)("assistant_tel"))
Dim Languages As String = Convert.ToString(dsRosterUpdate.Tables(0).Rows(i)("languages"))
Dim OtherInfo As String = Convert.ToString(dsRosterUpdate.Tables(0).Rows(i)("other_info"))
ImportLabel.Text &= RosterID & " " & LastName & " " & FirstName & " " & JobTitle & " " & Department & " " & Market & " " & BusinessUnit & " " & Division & " " & Email & " " & Tel & " " & DirectTel & " " & Fax & " " & Mobile & "<br>" & Address & " " & Assistant & " " & AssistantTel & " " & Languages & " " & OtherInfo & "<hr>"
If RosterID <> 0 Then
ImportLabel.Text &= "<font color='Blue'>Roster Update!</font><br>"
'UpdateRoster(RosterID, LastName, FirstName, JobTitle, Department, Market, BusinessUnit, Division, Email, Tel, DirectTel, Fax, Mobile, Address, Assistant, AssistantTel, Languages, OtherInfo)
Else
ImportLabel.Text &= "<font color='green'>Roster Insert!</font><br>"
'AddToRoster(LastName, FirstName, JobTitle, Department, Market, BusinessUnit, Division, Email, Tel, DirectTel, Fax, Mobile, Address, Assistant, AssistantTel, Languages, OtherInfo)
End If
i += 1
End While
End If
End Sub
Protected Function ExcelConnection() As OleDbCommand
Dim xConnStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/roster/temp/rosterimport.xls") & ";Extended Properties=Excel 8.0;"
Dim objXConn As New OleDbConnection(xConnStr)
objXConn.Open()
Dim objCommand As New OleDbCommand("SELECT * FROM [Roster$]", objXConn)
Return objCommand
End Function
|