
Alex_bg
Members-
Posts
17 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by Alex_bg
-
Hello, I am using ASP .NET. I would like to be able to catch different type of exceptions, and translate them to my languadge. How could I distinguish the different type of exceptions? Does every exception has a number, that will enable me to relate it to a special translation? I would be glad to receive any help on localizing exceptions. Thanks, Aleksandar
-
I get "Access denied" when using Dim wordApp As New Microsoft.Office.Interop.Word.App Hello, I am using VS 2003, ASP.NET and VB. I get a server error "Access denied" when I try to execute the following code: Dim wordApp As New Microsoft.Office.Interop.Word.Application the error has the following text: Access is denied. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.UnauthorizedAccessException: Access is denied. ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user. To grant ASP.NET write access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access. Source Error: Line 265: Line 266: Private Sub Button26_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button26.Click Line 267: Dim wordApp As New Microsoft.Office.Interop.Word.Application Line 268: Dim wdDoc As New Microsoft.Office.Interop.Word.Document Line 269: Dim txtRange As Microsoft.Office.Interop.Word.Range Source File: C:\Inetpub\wwwroot\paperless SMD\main page.aspx.vb Line: 267 Stack Trace: [unauthorizedAccessException: Access is denied.] paperless_SMD.WebForm1.Button26_Click(Object sender, EventArgs e) in C:\Inetpub\wwwroot\paperless SMD\main page.aspx.vb:267 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) +18 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain() +1273 Thanks, Aleks
-
Hello, If I use a OleDBDataAdapter wizard to generate Update and Insert commands on my select that is : SELECT Product, [Product group], [Main product], [EIS number], Description, [PCB AN], [sMD lot size], [Finished product], [Machine assembly sequence], [Two side SMD] FROM Products I get the following code for update generated by the wizard: Me.OleDbUpdateCommand1.CommandText = "UPDATE Products SET [Product group] = ?, [Main product] = ?, [EIS nu" & _ "mber] = ?, Description = ?, [PCB AN] = ?, [sMD lot size] = ?, [Finished product]" & _ " = ?, [Machine assembly sequence] = ?, [Two side SMD] = ? WHERE (Product = ?) AN" & _ "D (Description = ? OR ? IS NULL AND Description IS NULL) AND ([EIS number] = ? O" & _ "R ? IS NULL AND [EIS number] IS NULL) AND ([Finished product] = ?) AND ([Machine" & _ " assembly sequence] = ? OR ? IS NULL AND [Machine assembly sequence] IS NULL) AN" & _ "D ([Main product] = ? OR ? IS NULL AND [Main product] IS NULL) AND ([PCB AN] = ?" & _ ") AND ([Product group] = ? OR ? IS NULL AND [Product group] IS NULL) AND ([sMD l" & _ "ot size] = ? OR ? IS NULL AND [sMD lot size] IS NULL) AND ([Two side SMD] = ?)" Why is this code like ([Product group] = ? OR ? IS NULL AND [Product group] IS NULL) genrated? What it actually does? If I write the update clause myself it would be with a very short where clause (product is a primary key) like: Me.OleDbUpdateCommand1.CommandText = "UPDATE Products SET [Product group] = ?, [Main product] = ?, [EIS nu" & _ "mber] = ?, Description = ?, [PCB AN] = ?, [sMD lot size] = ?, [Finished product]" & _ " = ?, [Machine assembly sequence] = ?, [Two side SMD] = ? WHERE (Product = ?) What is the difference in the functionality in those two different ways of writing the where clause? I will be glad to get some links that will help me find information about this. Thanks, Aleksandar
-
Thanks, this solved a problem Yes, you are absolutely right. I have preinstalled SMTP component of IIS, and now the service works. How simple things could be ..., if there is someone to give you a clue. Thank you very much, Aleksander
-
Hello, I have made a simple windows service, sending mail, at a certain hour. I am using VB.NET. Unfortunatelly it does not work when I deploy it to a computer different from the one that is my Visual Studio on (the computer on which I have developed the service). It seems that everything is OK, I am starting it from "Services" in control panel, but it does not send any mail. I am installing the service by copying the bin and obj directories to the target computer, then running installutil from the bin directory. The install process passes without any errors. If you have any ideas, please help. Thanks, Aleksander
-
Thanks Thank you very much, this solved my problem. I changed the timer version and it started working.
-
Hello, Is there any special reason, a timer not to work when used in a windows service application? I am using a VB .NET, below is the code of the OnStart method. Protected Overrides Sub OnStart(ByVal args() As String) Me.Timer1.Interval = 1000 Me.Timer1.Enabled = True End Sub If you need any more info, please do not hesitate to ask. Thanks, Aleksandar
-
Hello, I am using ASP .Net and VB.NET in one web form. I am testitng it with IE 6 and Netscape 7.1 on Suse Linux 9.1, and I have a problem. The buttons (also textboxes, comboboxes), that are desighned with same length in Visual Studio .NET are displayed with different lengths in Netscape 7.1. In IE everything is OK. The targetschema property of the form displayed does not make any change. How can this problem be solved? Thanks, Alex
-
Thanks, this completely answers my question.
-
Hello all, I have problems when trying to update a date type field in a MS Access database with VB and ASP.NET OleDb.OleDbCommand. I am using the following update statement: Update [sMD plans] SET [Produced quantity]='123' WHERE (Product='345') and (shift='1') and (date=#02/01/2001#) Normally the date standart in my locale is dd.mm.yyyy, but if I send the date in this format to the database it returns an error. It accepts it only in format mm/dd/year. The database is on the same computer I am writing the code, and its default locale settings are for date format dd.mm.yyyy. Also I get the date in this format when I use DateTime.Now.ToShortDateString(). Because of this, when I want to update a date field, I have to make a special string operations to update my field. The culture property of my web page is set to BG-BG. Thanks, Aleksander
-
Private Sub btnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpdate.Click Try OleDbDataAdapter2.Update(Me.Dts_products1) Catch Ex As System.Exception MessageBox.Show(Ex.Message) MessageBox.Show(MainForm.err_string(3)) End Try End Sub Private Sub load_data() Try Me.OleDbDataAdapter2.Fill(Me.Dts_products1) Catch Ex As System.Exception MessageBox.Show(Ex.Message) MessageBox.Show(MainForm.err_string(2)) End Try End Sub Me.OleDbUpdateCommand1.CommandText = "UPDATE Products SET Product = ?, [Product group] = ?, [Main product] = ?, [EIS number] = ?, Description = ? WHERE (Product = ?) AND (Description = ? OR ? IS NULL AND Description IS NULL) AND ([EIS number] = ? OR ? IS NULL AND [EIS number] IS NULL) AND ([Main product] = ? OR ? IS NULL AND [Main product] IS NULL) AND ([Product group] = ? OR ? IS NULL AND [Product group] IS NULL)"
-
Hello, I am using MS Access dtb and VB.NET. I am using a dataset where I store the edited values. I am not changing any key values. The problem is that i can not update the dataset when I the table has a field that participates in relation. For example, if i have a table with three fields: Product Description Client If "product" participates in relation, if I change the "client" or "description" filed I get error on oledbdataadater.update. Thanks, Alex
-
Hello, I have a page in ASP.NET with a datagrid, dataview and dataset. I am retaining the dataset values in a viewstate during postbacks. When i click the delete or update button of my datagrid, the dataadapter updates the table with every record written twice. Here is the code in DataGrid1_DeleteCommand: Private Sub DataGrid1_DeleteCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles DataGrid1.DeleteCommand Dim key As String = DataGrid1.DataKeys(e.Item.ItemIndex).ToString() Dim dr As DataRow dr = Me.F_positions1.Tables(0).Rows.Find(key) Me.F_positions1.Tables(0).Rows.Remove(dr) Me.OleDbDataAdapter1.Update(Me.F_positions1) Me.DataGrid1.DataBind() End Sub The code i use to keep the dataset data is the following: In the page_load handler: If IsPostBack Then Me.F_positions1.Clear() Dim sr As New System.IO.StringReader(CStr(ViewState("ds_fiders"))) Me.F_positions1.ReadXml(sr) Me.DataGrid1.DataBind() end if In the prerender handler: Private Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.PreRender Dim sw As New System.IO.StringWriter Me.F_positions1.WriteXml(sw) ViewState("ds_fiders") = sw.ToString() End Sub I will give one example: If I have rows 'a','b' and 'c', and I click delete button on 'c' row, the dataadapter saves two identical records as 'a' , two as 'b' and one as 'c'. The record I delete is present only once in the database table, the others, twice. This doubles the records im my table on every click of the delete button. Please help! Thanks, Alex
-
Hello, I have two related tables with relationship one-to-many. If I try to update a record in a table that is on the "one" side, I get a message that this is not possible because there are related records. I am not changing the key the tables are related with. I am changing other fileds that do not participate in relations. Records are changed through a datagrid. How could I change this situation? The exact message when I press the update button is: "The record can not be deleted or changed, because "related_table_name" includes related records" I am using MS Access database through OLeDBProvider in a .NET application. I hope this problem has a solution. Thanks, Alex