Hi Watt, Thanks for conversion. However I can't use these codes. It gave me errors. Please advise. Thanks in advance, Chiari
Chiari
Posts
-
Convert into VB -
Convert C# to VB codeHi all, I really need to convert the C# code below into VB. If possible can advise me where is the most approriate place to place this portion of code. The code is to wire the parent datagrid for the ItemCreated event and ItemDataBound event. Please help me.
private void InitializeComponent() { this.load += new System.EventHandler(this.Page_Load); this.dgRegion.ItemCreated += new DataGridItemEventHandler(dgRegion_ItemCreated); this.dgRegion.ItemDataBound += new System.Web.UI.WebControls.DataGridItemEventHandler(this.dgRegion_ItemDataBound); }
Thanks in advance, Chiari -
Convert into VBHi all, I really need to convert the C# code below into VB. If possible can advise me where is the most approriate place to place this portion of code. The code is to wire the parent datagrid for the ItemCreated event and ItemDataBound event. Please help me.
private void InitializeComponent() { this.load += new System.EventHandler(this.Page_Load); this.dgRegion.ItemCreated += new DataGridItemEventHandler(dgRegion_ItemCreated); this.dgRegion.ItemDataBound += new System.Web.UI.WebControls.DataGridItemEventHandler(this.dgRegion_ItemDataBound); }
Thanks in advance, Chiari -
[VB.NET 2005] Sorting a comboboxHi, Maybe you can try to list as KL01, KL02, KL03 and so on... In this way, it will sort out as KL01, KL02, KL03, KL10. Chiari -- modified at 20:08 Monday 20th February, 2006
-
How to add relations with more than one primary keysHi All, I have to do parent and child relationship for two tables. However, I have more than one primary keys to add. How do I go about to do Relations.Add ? Please advise. Thanks in advance, Chiari
-
Error Occurs:"Object reference not set to an instance of an object."Hi, I met problem when run my application. I select a supplier from the combox. First time when I selected, the SupplierName and SupShortName displayed out nicely in the textbox. However, when I select another Supplier from the same combox, it pop out this error to me: "Object reference not set to an instance of an object." Below is the attached code. Private Sub Main_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim drApSupplier As SqlDataReader Dim cmdApSupplier As SqlCommand cmdApSupplier = New SqlCommand("LookupApSupplier", SqlConnection1) cmdApSupplier.CommandType = CommandType.StoredProcedure SqlConnection1.Open() drApSupplier = cmdApSupplier.ExecuteReader() While (drApSupplier.Read()) lstApSupplier.Items.Add(drApSupplier("Supplier")) End While lstApSupplier.Items.Add("Please Select Supplier") lstApSupplier.SelectedIndex = lstApSupplier.Items.Count - 1 End Sub Private Sub lstApSupplier_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstApSupplier.SelectedIndexChanged Dim strApSupplier As String = Trim(CStr(lstApSupplier.SelectedItem)) Dim drApSupplier As SqlDataReader If Not (strApSupplier) = "Please Select Supplier" Then Try Dim cmdApSupplier As SqlCommand cmdApSupplier = New SqlCommand("LookupSupplier", SqlConnection2) cmdApSupplier.CommandType = CommandType.StoredProcedure Dim sqlParam As New SqlParameter sqlParam = cmdApSupplier.Parameters.Add("@Supplier", SqlDbType.Char, 7) sqlParam.Value = strApSupplier SqlConnection2.Open() drApSupplier = cmdApSupplier.ExecuteReader() drApSupplier.Read() txtSupplierName.Text = Trim(CStr(drApSupplier("SupplierName"))) txtSupShortName.Text = Trim(CStr(drApSupplier("SupShortName"))) Catch ex As Exception MessageBox.Show(ex.Message & " " & ex.StackTrace & " " & ex.Source) Finally drApSupplier = Nothing SqlConnection2 = Nothing End Try Else Exit Sub End If End Sub Please help. Thanks in advance, Chiari
-
Regular ExpressionHi, This site maybe useful to you. http://www.glasshaus.com/samplechapters/1051/[^] Chiari
-
Javascript menu doesn't work after server round tripOk... It's like this. I have a menu called Coporate Profile. Under the menu, there is a submenu contain 'Asia', 'Europe' and 'North America'. When I moveover my cursor 'Corporate Profile', it will show the submenu. But this only work when the page is show without any server round trips been done or the page get refresh. If I done a server round trip, the submenu will not appear when the cursor is move over. Can help me to find out what goes wrong? Thanks in advance, Chiari
-
Javascript menu doesn't work after server round tripHi, I'm having a problem. I found that my javascript menu doesn't work after a server round trip. Any one can help, please? Thanks in advance, Chiari :doh: -- modified at 9:27 Saturday 22nd October, 2005
-
Session time outIs there a solution for me? I want the message box to be show and redirect to the login page after the session time out. Thanks, Chiari
-
Unable to script libraryThere is already has a copy at the location you mentioned. But it still said it can't find the location. Thanks, Chiari
-
Unable to script libraryHi, I've this error when I directing to another page. Unable to find script library '/aspnet_client/system_web/1_1_4322/WebUIValidation.js'. Try placing this file manually or reinstall by running 'aspnet_regiis -c'. I've done reinstall many times but I still got this message. I replace the file manually and still doesn't solve. I replace it in 'C:\inetpub\wwwroot'. Is this the correct location ? Please help. Thanks in advance, Chiari
-
Session time outHi, I'm trying to write something on Session Timeout. I want to display a message box before it redirects the page to the login page. I'm using .ASP net.I have configure the web.config under the sessionstate as timeout 1 min, but the Session_OnEnd event I wrote doesn't fire. Can anyone help me on it? Thanks in advance, Chiari
-
Error occurHi there, I know what went wrong and I have corrected it by using HTML input button. Thanks a lot. Chiari :-D
-
Error occurHi, I'm trying to ask a web button to fire an event in javascript which is called PrntPreview(). But when I run, it gave this error below: BC30456: 'PrntPreview' is not a member of 'ASP.DisplayStkCode_aspx'. Anyone can tell me wat is wrong? Thanks in advance, Chiari
-
Validating controls in datagrid with javascriptHi, Your advice really help me a lot. I'm able to get the reference to the control. Thanks a lot, Chiari :laugh:
-
Validating controls in datagrid with javascriptI passed in the parameter to it when calling the function. onblur="return vldValue(this.value)" Chiari
-
Validating controls in datagrid with javascriptHi, I tried using it but it return null value. Ok... My datagrid id is 'dgStkcode' and the id/name of the control inside this datagrid is 'EditAsCast'. So is it rite for me to write the code as ... var txtbox = document.getElementById("dgStkcode_ctl1_EditAsCast"); txtbox.focus(); ... Please correct me. I tested out something. When the code is ... var txtbox = document.getElementById("dgStkcode"); ... It return [object] to me. Does this means it got the id of the datagrid? Thanks a lot Chiari :)
-
Validating controls in datagrid with javascriptHi, I have tried to set the focus by using object.focus() method, it doesn't work on controls in datagrid. Simply, I can't found any reference of the control. It prompt an error as null. By the way, do you know the code of using SendKeys in javascript? Thanks a lot, Chiari
-
Validating controls in datagrid with javascriptHi everyone, I have a problem on validation the controls in the datagrid. When I entered a control and enter an invalid value, the control will fire OnBlur event after I lost the focus of the control. It show me the alert message but the focus is not set back to the control that has the invalid value. Anyone, please help me on how to set back the focus on the control with the invalid value after the alert message is showed, so that the user will immediately know he had entered an invalid value. Below is my javascript function vldValue(args) { var IsValid; var validFormatRegExp = /^((\-)\d)?\d*(\.\d{3})?$/; IsValid = validFormatRegExp.test(args); alert("Invalid Value!"); return IsValid; } thanks a lot in advance. Chiari