Jump to content
Xtreme .Net Talk

mazlina

Members
  • Posts

    13
  • Joined

  • Last visited

About mazlina

  • Birthday 05/16/1981

Personal Information

  • Visual Studio .NET Version
    Visual Basic .NET Standard
  • .NET Preferred Language
    VB.NET

mazlina's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. hi, I have checkbox as template within a datagrid. But how do I capture the value of other column in the datagrid with checkbox that has been tick? for example, my dg has col for date, time, name and checkbox. when i tick the checkbox and click send button, how do i get the date and time for the checkbox?
  2. i haven't yet try using myCommand.dispose but i do try to give permission for everyone in my database folder allowed write and modify and it's work. could it be the main problem actually?
  3. i've check the process aspnet_wp.exe and end that process. but it still didn't work.....is there any other possible error that i've done?
  4. Sub Page_Transfer(ByVal sender As System.Object, ByVal e As System.EventArgs) Dim staff As String Dim status As String Dim name As String Dim strOutput As String 'connection myConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Inetpub\wwwroot\TimeManagement\AttendanceReport.mdb;") myCommand = New OleDbCommand("select * from TableUserPassword where UserStaffID = '" & txtStaffID.Text & "' and UserPassword = '" & txtPassword.Text & "' ", myConnection) myConnection.Open() Dim myDataReader As OleDbDataReader = myCommand.ExecuteReader While myDataReader.Read If myDataReader("UserStaffID") = txtStaffID.Text And myDataReader("UserPassword") = txtPassword.Text Then Session("status") = myDataReader.Item("Status") Session("StaffID") = txtStaffID.Text Session("UserName") = myDataReader.Item("UserName") status = Session("status") staff = Session("StaffID") name = Session("UserName") context.Items("txtStaffID") = txtStaffID.Text context.Items("txtPassword") = txtPassword.Text 'LogUser(name, "IN") Server.Transfer("framePage.aspx") End If End While alert.Text = "Error Login!!" myDataReader.Close() myConnection.Close() End Sub
  5. I am working on a little application, aspx pages and web services. I use MS Access for a database. All the time I try to get the results of a query I get the following error: Could not use ''; file already in use. Exception Details: System.Data.OleDb.OleDbException: Could not use ''; file already in use Stack Trace: [OleDbException (0x80004005): Could not use ''; file already in use.] System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) System.Data.OleDb.OleDbConnection.InitializeProvider() System.Data.OleDb.OleDbConnection.Open() TimeManagement.FormLogin.Page_Transfer(Object sender, EventArgs e) in c:\inetpub\wwwroot\TimeManagement\FormLogin.aspx.vb:66 System.Web.UI.WebControls.Button.OnClick(EventArgs e) System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) System.Web.UI.Page.ProcessRequestMain() The database is neither open nor used by someone else. I am very greatful for some advice!
  6. i still got this error msg.... Format of the initialization string does not conform to specification starting at index 88. Line 63: myConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source= & Server.MapPath & '/AttendanceReport.mdb';")
  7. below is my connection string............. myConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=Server.MapPath/AttendanceReport.mdb;") i've got this error............. 'C:\WINNT\system32\Server.MapPath\AttendanceReport.mdb' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides. which means that it read the wrong path of my database. how can i make changes of my server.mappath so that it read C:\Inetpub\wwwroot.........
  8. i'm having problem in datagrid paging while i'm using a dropdownlist to specify a value to which data to be shown.....on my first page, it's viewing the right data but not on the following pages.
  9. this is where the error stated :- Source Error: Line 131: 'approve = e.Item.Cells(6).Controls(0) Line 132: 'approve = e.Item.FindControl("Label1") Line 133: approve = CType(e.Item.Cells(6).Controls(0), ListBox).SelectedItem.Value Line 134: Line 135: 'approve = CType(e.Item.FindControl("Label1"), Label).Text Source File: c:\inetpub\wwwroot\TimeManagement\WebForm5.aspx.vb Line: 133 Stack Trace: [invalidCastException: Specified cast is not valid.] TimeManagement.WebForm5.dgUserAttendance_Update(Object sender, DataGridCommandEventArgs e) in c:\inetpub\wwwroot\TimeManagement\WebForm5.aspx.vb:133 System.Web.UI.WebControls.DataGrid.OnUpdateCommand(DataGridCommandEventArgs e) System.Web.UI.WebControls.DataGrid.OnBubbleEvent(Object source, EventArgs e) System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) System.Web.UI.WebControls.DataGridItem.OnBubbleEvent(Object source, EventArgs e) System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) System.Web.UI.Page.ProcessRequestMain() '------------------------------------------ n this is my exact code Sub dgUserAttendance_Update(ByVal sender As Object, ByVal e As DataGridCommandEventArgs) 'determine the value of the StaffID column Dim name As String = e.Item.Cells(1).Text Dim accessDate As String = e.Item.Cells(0).Text 'refrence textbox Dim approve As String 'Dim dataGridItem As DataGridItem 'approve = e.Item.Cells(6).Controls(0) 'approve = e.Item.FindControl("Label1") \*************************************** the error is in this line................ approve = CType(e.Item.Cells(6).Controls(0), ListBox).SelectedItem.Value \*********************************** 'approve = CType(e.Item.FindControl("Label1"), Label).Text 'CType(e.Item.FindControl("Label2"), Label).Text updateApprove(accessDate, name, approve) dgApproveStaff.EditItemIndex = -1 dgApproveStaff.DataSource = getStaff() dgApproveStaff.DataBind() End Sub Function GetApproval() conn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=E:\database\AttendanceReport.mdb;") myCommandApproval = New OleDbCommand("SELECT * from TableApproval", conn) conn.Open() Dim approvalReader As OleDbDataReader approvalReader = myCommandApproval.ExecuteReader Return approvalReader approvalReader.Close() conn.Close() End Function Public Sub ItemDataBound(ByVal sender As Object, ByVal e As DataGridItemEventArgs) If (e.Item.ItemType = ListItemType.EditItem) Then Dim drv As DataRowView drv = e.Item.DataItem Dim oldApproval As String oldApproval = drv("Approval").ToString() Dim ddl As ListBox = e.Item.FindControl("Approval") ddl.SelectedIndex = ddl.Items.IndexOf(ddl.Items.FindByText(oldApproval)) End If End Sub
  10. is it my syntax error that is not possible for FindControl method?
  11. value in SelectedItem is given after user select from the DropDownList right? Label1 is my id....... <asp:TemplateColumn HeaderText="Approval"> <ItemTemplate> <asp:Label Width="200" Runat="server" text='<%# DataBinder.Eval(Container.DataItem, "Approval") %>' ID="Label1"> </asp:Label> </ItemTemplate> <EditItemTemplate> <asp:ListBox SelectionMode=Single ID="Approval" Runat="server" Rows="1" DataSource="<%# GetApproval()%>" DataTextField="Approval" DataValueField="Approval"> </asp:ListBox> </EditItemTemplate> </asp:TemplateColumn>
  12. Dim name As String = e.Item.Cells(1).Text Dim accessDate As String = e.Item.Cells(0).Text 'refrence textbox Dim approve As String Dim dataGridItem As DataGridItem 'error occured at this point approve = CType(e.Item.FindControl("Label1"), DropDownList).SelectedItem.Text updateApprove(accessDate, name, approve) dgApproveStaff.EditItemIndex = -1 dgApproveStaff.DataSource = getStaff() dgApproveStaff.DataBind()
  13. i've got this error while running my program. i have dropdownlist in my datagrid for updating my data in dbase. this is part of my code that i'm using right now....... Dim name As String = e.Item.Cells(1).Text Dim accessDate As String = e.Item.Cells(0).Text 'refrence textbox Dim approve As String Dim dataGridItem As DataGridItem approve = CType(e.Item.FindControl("Label1"), DropDownList).SelectedItem.Text updateApprove(accessDate, name, approve) dgApproveStaff.EditItemIndex = -1 dgApproveStaff.DataSource = getStaff() dgApproveStaff.DataBind()
×
×
  • Create New...