Jump to content
Xtreme .Net Talk

lorena

Avatar/Signature
  • Posts

    134
  • Joined

  • Last visited

Everything posted by lorena

  1. We managed a work around by adding my account to the server's power user account. I guess the answer to it all is, if you are a developer, never change your password! Hardly secure though...
  2. I do all of my development on our intranet server. I have a network drive mapped to the server and, in the past, I was always able to create a new project on the intranet server and go from there. Our intranet server had not been rebooted in a while. In between the time it was last rebooted and today, I had to change my network password (*ugh*). The server was rebooted a day or two ago and now, when I try to create a new project, I get this message: "Web Access Failed" With this error returned: "Unable to create web project 'blah'. Unable to create web location 'intranet.blah.com\webApp1'. Access is denied" Where are these permissions created? I have been working with our network guys to try to restore my access (initially, I couldn't even map a drive to the server - it was seeing me as coming in as "IUSR") I would really appreciate any help on this as I am tearing my hair out!
  3. I have a little online form that accepts an employee's first and last name and their selection of a class time from a dropdown. On submit, the form adds a new record to the "employee" table with the employee first and last name and then updates the "classList" table, adding one to the number of students registered to the class selected (since each class can only have 25 students). It is an Access 2003 database. The problem is the database hangs up. Somewhere in my code, I am not properly closing the connection. Needless to say, when enough people hit the database, it causes big problems on the server. I really need help!! Thanks in advance. Here is my code: If Page.IsValid Then Dim objConn As New OleDbConnection(sConnStr) Dim strFName, strLName As String Dim intID As Integer strFName = txtFName.Text strLName = txtLName.Text intID = ddlClasses.SelectedItem.Value Dim clID As New OleDbParameter("@clID", OleDbType.Integer) clID.Value = intID strSQL = New System.Text.StringBuilder() strSQL.Append("INSERT INTO employees (FName, LName, Class_ID) VALUES ('" & txtFName.Text & "','" & txtLName.Text & "', '" & intID & "' )") Dim objCommand As New OleDbCommand(strSQL.ToString, objConn) objConn.Open() objCommand.ExecuteNonQuery() strSQL = New System.Text.StringBuilder() strSQL.Append("UPDATE classList SET studentCt = studentCt + 1 WHERE Class_ID = " & intID & " ") objCommand = New OleDbCommand(strSQL.ToString, objConn) lblTest.Text = strSQL.ToString objCommand.ExecuteNonQuery() objConn.Close() objConn = Nothing lblThanks.Visible = True btnSubmit.Visible = False End If
  4. Is there any way to open an MS Access Report in ASP.Net?
  5. Thanks, Chris. Actually, I have the Bischoff book - guess I didn't get far enough into it to find out how to launch a report programmatically. Thanks for the website. I have added it to my favorites. If you do find any code, please post it. Meanwhile, I will keep digging. Thanks again!
  6. I am fumbling my way through teaching myself Crystal Reports in VS.Net 2003 I can set up a report using the Extreme.mdb provided for testing purposes. Now, I want to use code to set the database connection and report source. I thought I had it set up correctly but I am getting "ConnectionString property has not been initialized" Here is my code: Sub BindReport() Dim objConn As SqlConnection Dim uName As String = System.Configuration.ConfigurationSettings.AppSettings("mappedname") Dim pass As String = System.Configuration.ConfigurationSettings.AppSettings("mappedkey") Dim strConn As String = "SERVER=Intranet\tdsmfg;DATABASE=mtc_req;user id= " & uName & ";password= " & pass Dim objCommand As SqlCommand Dim objSqlAdapter As SqlDataAdapter objConn = New SqlConnection(Session(strConn)) objCommand = New SqlCommand objSqlAdapter = New SqlDataAdapter objCommand.Connection = objConn objCommand.CommandType = CommandType.StoredProcedure objCommand.CommandText = "Requests_Read" objConn.Open() objSqlAdapter.SelectCommand = objCommand Dim objDS As New DataSet objSqlAdapter.Fill(objDS, "requests") Dim oRpt As New rpt2 oRpt.SetDataSource(objDS) CrystalReportViewer1.ReportSource = oRpt CrystalReportViewer1.DataBind() End Sub I would appreciate any help with this. Thanks!
  7. I have a datagrid with three date fields (among other fields) in it that loads from a database table. When the user edits the grid, there is a clickable image that triggers some javascript that opens a little window with a calendar control. When the user clicks the control, the date in the edit textbox is changed. The grid was working fine until I added a dropdown to enable the user to select the type of records he or she wants to look at. Now, when the grid is in edit mode, you can click on the image, the calendar loads but clicking on the calendar no longer changes the date in the textbox. Why would the addition of the dropdown cause that to happen? Here is the code for the calendar and the dropdown: 'This is part of the datagrid ItemDataBound If e.Item.ItemType = ListItemType.EditItem Then 'Set date for calendar control Dim sTextBoxName As String = e.Item.Cells(19).FindControl("txtEditStDate").ClientID() CType(e.Item.FindControl("lnkStCalendar"), HyperLink).NavigateUrl = _ "javascript:calendar_window=window.open('Calendar.aspx?formname=frmReqs." & sTextBoxName & "','Pick_A_Date','width=180,height=210');calendar_window.focus();" End If 'This is part of a BindData sub used to populate the datagrid Select Case ddlView.SelectedIndex Case 0 'ALL objCommand.CommandText = "Requests_Read" Case 1 'PENDING objCommand.CommandText = "Requests_Pending" Case 2 'ACTIVE objCommand.CommandText = "Requests_Active" Case 3 'CLOSED objCommand.CommandText = "Requests_Closed" pnlMoYr.Visible = True Case 4 'ARCHIVE intMo = ddlMo.SelectedItem.Value intYr = ddlYr.SelectedItem.Value dtBeg = DateSerial(intYr, intMo, 1) dtEnd = DateSerial(intYr, intMo + 1, 1 - 1) strSQL = "SELECT * FROM toolroom_test " & _ "WHERE PRIORITY='DONE' " & _ "AND COMPLETE_DATE BETWEEN #" & dtBeg & "# AND #" & dtEnd & "#" End Select
  8. Never mind. I figured it out.
  9. I have a datagrid that lists files in a directory with hyperlinks to each file. I would like each hyperlink to be the filename without the extension but then I need the filename with the extension for the hyperlink. Here is the relevant part of my code: Sub BindData() 'variables defined in this part - not shown filesTable.Columns.Add("Name", Type.GetType("System.String")) ' Get File Info arrFileInfo = dirInfo.GetFiles("*.aspx") For Each filesInfo In arrFileInfo If filesInfo.Name <> "dr.aspx" and filesInfo.Name <> "Search.aspx" then drFiles = filesTable.NewRow() ofn = filesInfo.Name charCt = Instr(ofn, ".aspx") -1 ofn = Mid(ofn, 1, charCt) drFiles("Name") = ofn filesTable.Rows.Add(drFiles) End If Next filesInfo 'code for the hyperlink column in the datagrid <asp:HyperLinkColumn Target="_blank" DataNavigateUrlField="Name" DataNavigateUrlFormatString="{0}" DataTextField="Name"/> Thanks for any help
  10. Thanks! That was something (one of many things, I'm sure) that I didn't know.
  11. Thanks for this. I am not sure what you mean by "accepting the changes" to the dataset. How do I do that?
  12. I have two identical pages that list out the contents of two different folders with hyperlinks to each file. One works, the other doesn't. On the one that doesn't I get this error: "Control 'dgFiles__ctl24__ctl1' of type 'DataGridLinkButton' must be placed inside a form tag with runat=server" There are 29 files in the folder with the page that doesn't work. If I set the page size to "20" I get the error above, if I set it to "15" I get the same error but the Control is 'dgFiles__ctl19__ctl1'. If I set the page size to "30" (one more than the number of files in the folder) - it works. The other folder with the same type of page has hundreds of files in it and the paged datagrid works fine. I don't get it. Here is all of my code: <%@ Import Namespace = "System.Web" %> <%@ Import Namespace = "System.Data" %> <%@ Import Namespace="System.IO" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <title>Opportunities for Improvement - Closed</title> <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema"> <script language="VB" runat="server"> Sub Page_Load(sender as Object, e as EventArgs) If Not Page.IsPostBack then BindData End If End Sub Sub dgFiles_Paging(ByVal s As Object, ByVal e As DataGridPageChangedEventArgs) dgFiles.CurrentPageIndex = e.NewPageIndex BindData() End Sub Sub BindData() Dim dirInfo as New DirectoryInfo(Server.MapPath("/p1/Quality/Corr_Prev_Action_Cases/Opportunities for Improvement/Testing")) Dim arrFileInfo As Array Dim filesInfo As FileInfo Dim filesTable As New DataTable Dim drFiles As DataRow Dim dvFiles As DataView filesTable.Columns.Add("Name", Type.GetType("System.String")) filesTable.Columns.Add("LastWriteTime", Type.GetType("System.DateTime")) ' Get File Info arrFileInfo = dirInfo.GetFiles("*.pdf") For Each filesInfo In arrFileInfo drFiles = filesTable.NewRow() drFiles("Name") = filesInfo.Name drFiles("LastWriteTime") = filesInfo.LastWriteTime filesTable.Rows.Add(drFiles) Next filesInfo dvFiles = filesTable.DefaultView dvFiles.Sort = "LastWriteTime DESC" dgFiles.DataSource = dvFiles dgFiles.DataBind() End Sub </script> <link href="http://intranet.talleyds.com/sklog/styles/tocDOC.css" type="text/css" rel="stylesheet"> </HEAD> <body MS_POSITIONING="GridLayout"> <% Response.WriteFile ("../includes/qHeader.asp") %> <p><a class="subDept" href="http://intranet.talleyds.com/viper/quality/ca/ca.asp">CORRECTIVE AND PREVENTATIVE ACTION</a></p> <FORM> <asp:datagrid id="dgFiles" style="Z-INDEX: 101; LEFT: 20px; POSITION: absolute; TOP: 120px" runat="server" CellPadding="5" CellSpacing="3" AutoGenerateColumns="False" ShowHeader="True" Width="293px" AllowPaging="True" PageSize="40" OnPageIndexChanged="dgFiles_Paging"> <ItemStyle Font-Size="XX-Small" Font-Names="Verdana" Font-Bold="True" ForeColor="#336699" BackColor="White"></ItemStyle> <HeaderStyle Font-Size="XX-Small" Font-Names="Verdana" Font-Bold="True" ForeColor="#660033" CssClass="TH"></HeaderStyle> <Columns> <asp:HyperLinkColumn DataNavigateUrlField="Name" target="_blank" DataNavigateUrlFormatString="http://intranet.talleyds.com/p1/Quality/Corr_Prev_Action_Cases/Opportunities for Improvement/Testing/{0}" DataTextField="Name" HeaderText="Opportunities for Improvement - Testing"></asp:HyperLinkColumn> <asp:BoundColumn DataField="LastWriteTime" SortExpression="Date" Visible="False" HeaderText="File Last Modified" DataFormatString="{0:d}" /> </Columns> </asp:datagrid> </FORM> </body> </HTML>
  13. Never mind - I figured it out dvFiles.Sort = "Date DESC" And it worked
  14. I have a datatable with information from files in a directory. I would like to do a reverse sort by the LastWriteDate so that the most recent file will display first. Is there a way to do this? Here is my code: Sub BindData(strSortBy As String) Dim dirInfo as New DirectoryInfo(Server.MapPath("/p1/Quality/Corr_Prev_Action_Cases/Opportunities for Improvement/Closed")) Dim arrFileInfo As Array Dim filesInfo As FileInfo Dim filesTable As New DataTable Dim drFiles As DataRow Dim dvFiles As DataView ' The table is pretty simple... could store more info, but this is ' all I display so it's all I'm storing. filesTable.Columns.Add("Name", Type.GetType("System.String")) filesTable.Columns.Add("LastWriteTime", Type.GetType("System.DateTime")) ' Get File Info arrFileInfo = dirInfo.GetFiles("*.pdf") For Each filesInfo In arrFileInfo drFiles = filesTable.NewRow() drFiles("Name") = filesInfo.Name drFiles("LastWriteTime") = filesInfo.LastWriteTime filesTable.Rows.Add(drFiles) Next filesInfo dvFiles = filesTable.DefaultView dvFiles.Sort = strSortBy dgFiles.DataSource = dvFiles dgFiles.DataBind() End Sub
  15. I have an asp.net datagrid and when I delete a date from a date field, the value is set to 1/1/1900. What do I need to do to just set it to null? Here is the code for the value: If CType(e.Item.FindControl("txtEditSchedComplDate"), TextBox).Text <> "" then SchedComplDate = Convert.ToString(CType(e.Item.FindControl("txtEditSchedComplDate"), TextBox).Text) Else SchedComplDate = DBNull.Value.ToString End If The variable SchedComplDate is dimmed as Object. Any help/advice would be appreciated.
  16. Thanks for the help. I am still fumbling my way through many things having to do with .NET!
  17. That looks workable. If you can find the rest, that would be great. Thanks!
  18. I have a form with a datagrid on it that allows users to view details of the transactions listed in the grid. Right now, it hyperlinks to an existing page (I set the target="_blank" so it opens a new window) which shows the desired records.I am wondering if there is a way to make the new window essentially a popup window or in some way control its size?
  19. I did have it disabled. Is that the problem?
  20. Error Question I am developing an asp.net application on our intranet server from my local pc. I am developing it using the intranet url as part of my project name - so "http://myintranet.com/myproj" The problem I have is (and I think this may be because I am not actually working on the server), the application will not show me runtime errors when they occur. I just get that "error in whatever application" and it tells me to set custom errors to "off" (which I did) but I still cannot see them. I think this is probably why I am not able to debug my web applications since I am working on one computer with the application on another. Is that why? I hope I am making sense here. I am sure there is some kind of setting or something I am missing. I would appreciate any help with this as it is driving me crazy.
  21. Sorry - this was a programmer problem - not a control problem.
  22. txtReqDate.Text = dtmDate.ToShortDateString
  23. I don't understand why this worked in the old version of VS.Net and not in the new version. I tried searching the MSDN KB but couldn't find anything. *sigh* Their search leaves alot to be desired...
  24. P.S. - the boolean values are dimmed earlier in the code. This is the line that is erroring txtReqDate.Text = dtmDate.ToShortDateString
×
×
  • Create New...