1.What is the equivalent settings for option strict on and option explicit on in c# ? 2.I have a class in another project ( VC++). I want to access the methods and properties in VC++ class from my project in C#. The VC++ is a standalone EXE project and hence I cant add any reference to my project. But in VB I found a method named GetObject( "AssemblyName") to retrieve the object in runtime. As VB.Net supports early binding by setting option explicit ON , the methods and properties of the VC++ class can be accessed by creating an instance of system.object. Can anyone please tell me how can we do the same in C#.net ? 3.Is there any C# equivalent function for "ON ERROR RESUME NEXT" in VB ? We can use Try catch but catch block will be excuted if any error occur in try block.
BINOVAR
Posts
-
CSharp equivalent functions -
E_NoInterface ErrorThanks Dave for your reply. I tried the following 1)
<STAThread()> _
and<MTAThread()> _
before the class is intialized. Is it the correct place ? 2)System.Threading.Thread.CurrentThread.ApartmentState = Threading.ApartmentState.STA But still no luck. I verified after changing threading model in Registry. It is getting reflected and the Guid is matching with my code. Any more suggestion please. -
E_NoInterface ErrorHi All, I upgraded a project from VB to VB.net ( ActivexDll). After converting while debugging I am getting an error "E_nointerface". Can any one please tell me why do we get this error? Through goggling I found some results telling it may be due to threading conflicts. If so please tell me how to set threading in VB.Net.( In VB I found that threading mode is set to "Apartment" in project properties similarly how do we do it in Visual studio 2003 )
-
To display text when user clicks checkboxIam using Ajax is there any diff. approach to finish it using Javascript aspx page
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional"> <ContentTemplate> <!-- <asp:Panel ID="Panel2" runat="server"> --> <table id="Table2" cellspacing="0" cellpadding="0" runat="server" class="Table2Style" > <tr id="rowDD" runat="server"> <td width="115px"> <asp:Label ID="DDLabel" runat="server" CssClass="LabelText" ></asp:Label> </td> <td id="colDDImage" width="17px" background="Images/DDImage.bmp" runat="server"> </td> </tr> </table> <!-- <tr> --> <!-- <td colspan="2"> --> <div id="Div1" runat="server"> <!-- <asp:Panel ID="Panel1" runat="server" > --> <table id="Table1" cellspacing="0" cellpadding="0" runat="server" class="Table1Style"> <tr runat="server" id="rowChk"> <td width="132px"> <asp:CheckBoxList ID="Chk_countries" runat="server" CssClass="CheckBoxList" AutoPostBack="True" OnSelectedIndexChanged="Chk_countries_SelectedIndexChanged"> </asp:CheckBoxList> </td> </tr> </table> <!-- </asp:Panel> --> </div> <!-- </td> --> <!-- </tr> --> <!-- </table> --> <!-- </asp:Panel> --> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="Chk_countries" /> </Triggers> </asp:UpdatePanel>
aspx.cs pageprotected void Chk_countries_SelectedIndexChanged(object sender, EventArgs e) { string str_CheckedValue = ""; for (int i = 0; i < Chk_countries.Items.Count; i++) { if (Chk_countries.Items[i].Selected == true) { str_CheckedValue = str_CheckedValue + Chk_countries.Items[i].Value + ","; } } if (str_CheckedValue.Length > 0) { str_CheckedValue = str_CheckedValue.Substring(0, str_CheckedValue.Length - 1); DDLabel.Text = str_CheckedValue; } else { DDLabel.Text = SelectDefaultText; DDLabel.ToolTip = SelectDefaultText; } }
-
.sln filemy solution file is getting saved in the default location of dotnet which is in Document settings..Can any one please tell me how to save .sln file with the .aspx files Thanks in advance
-
Last value in a Tablehi all Thanks for ur reply.. If I order by I vl not get the last value in the table.. I want the last record in the table .
-
Last value in a Tablehow to find the last value in a Table . My table was designed by another person ..it doesnt have any Identity column .. It has only EMPname,Empaddress,EmpContactno. can any one pls tell me how to find the last value in the table Thanks in advance Regards Bino varghese
-
dynamically adding controlsIm adding textboxes in my asp.net page on button click inside a panel,which i have placed in my page. but the new control is getting created ,Im losing the old dyanmically create textbox.here is my code. Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click i = Convert.ToInt16(Session(ID)) Dim textbox As New TextBox textbox.ID = "textbox" & i textbox.Text = textbox.ID textbox.Style("top") = "800px" Panel1.Controls.Add(textbox) i = i + 1 Session(ID) = i End Sub Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Page.IsPostBack = False Then Session(ID) = i ' MsgBox(Session(ID)) Else ' MsgBox("2") End If End Sub dont know what is the mistake Im doing.Possibly its anything to do with Viewstate? Thanks in advance
-
runtime controlsHi can any one tell me how to add controls at runtime. I have a button on clicking it I have to add N no of textbox to enter the values. thanks in advance.
-
Paging in GridviewI got the output i required ..Thanks.
-
Paging in GridviewThank you all for your replies. I have added GridView1.PageIndex = e.NewPageIndex in Pageindexing event of the gridview ..now no errors but the gridview is not populating any values.I believe I have to add some code to show exactly that particular page.Can any one pls give a Jist Idea about it. Thanks in advance
-
Paging in GridviewIam Binding a gridview through code without using Datasource.I have enabled Paging.But I get the below error when I click the paging below.Is there any other properties I have to set ? The GridView 'GridView1' fired event PageIndexChanging which wasn't handled. Thanks In advance..
-
Find date diiferenceThank you ..will check your reference site..
-
Find date diiferenceHi all, can any please tell me how to find difference between two dates in a web application using Vb.net. I used diff1 = (CDate(day2).Subtract(CDate(day1)).TotalHours) Label11.Text = diff2 & "hrs" diff3 = (CDate(day3).Subtract(CDate(day2)).TotalHours) Label12.Text = diff3 & "hrs" Its working fine in the Local system without any conversion problems,but in a intranet its showing error Conversion from string "13/04/2006 4:11:50 PM" to type 'Date' is not valid. please give me suggestions Thanks in Advance Bino Varghese
-
Aspx page in different Languagesthank you will check the link above
-
Aspx page in different LanguagesHi , Can any one please tell me how to convert our aspx page into different languages. My exact requirement is .... I have to develop a site in two languages.can any one please help me and guide me in this. Thanks in Advance. Bino Varghese
-
Get Values from GridCan any one pls tell me how to get the values that are being displayed in grid..I have to get those values in the grid and update the database...
-
Interview Questions [modified]Thanks for your wishes Christian .Me to hope for the same from this moment:)
-
Interview Questions [modified]sorry Christian I understood my mistake.I take it in the right way which will lead me in the correct path and master C#. No not discouraged by the responses .TO be honest yes,was upset intially ,after some good advices I understood that its my mistake.Sorry again. Thanks again
-
Interview Questions [modified]Thanks Guffa.. I vl definetly do it and cum back to u for my doubts. Thanks again