Type.GetType does not work in VB.NET but works in C#. VB.NET gurus Please help
Friends, I am an experienced C# programmer who is working on a VB.NET project now. I am writing different methods covering the following functionalities 1) Take a datareader as input and return an arraylist of class object2) Take an xmlnode (received from a webservice) as input and return an arraylist of class object. The methods are generic methods which take datareader/xmlnode as first parameter and classname (string) as the second parameter. This way it will work trivially. The schema of class object matches with the input (datareader or xmlnode)In C# I used to do th...
Sending SMS using vb.net or C#.net using vb.net or c#.net
Hi
My requirement is
I hav one csv file with these fields id,mobilenum,messgae,status.intiallu staus is 0.
once i read the all fileds and take that mobile number.using tat mobile number i need to send sms .after sending sms i shuld change status as 1
How to send sms thru coding (please dont provide any links.if it is provide also please give working links becox i checked codeproject .i didnt get any nice link.
and also provide the how to update the status field im csv file
Thank
ssandhya
To send SMS, you need some third party SMS providers. if you consul...
vb.net code works but not c# code
Hello,
I'm trying to insert the metatags dynamically.
The following vb code works fine:
aspx.vb code:
Protected myTag As System.Web.UI.HtmlControls.HtmlGenericControl
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
myTag.Attributes("content") = "test"
End Sub
In aspx file head:
<meta id="myTag" runat="server" />
The above code is working great. But the same thing I'm trying to put in C# which is not working.
aspx.cs code:
...
System.web.UI doesn't work in VB.Net Form?
Hi, I downloaded a little example recently and tried converting it to VB.Net. Surprisingly I found that while my VB Web projects and CSharp Windows Form projects work with System.web.UI, VB Windows Forms don't seem to. Is there any way I can use System.web.UI features with a windows form? This is the code I'm trying to convert to VB: using System.IO;using System.Web.UI.WebControls;using System.Web.UI;// render the DataGrid control to a fileusing(StreamWriter sw = new StreamWriter(textBox1.Text)){ using(HtmlTextWriter hw = new HtmlTextWriter(sw)) { g...
I cannot get my C#.NET Email Form to work on Godaddy hosting account. Please Help!!!!
Hello;
I have created a contact us page and I am using .NET Mail classes to send the form via email. However I keep getting this error when I upload my info to the hosting server...
Request for the permission of type 'System.Net.Mail.SmtpPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Oh and yes, it wont send any emails.
here is my code...
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.Web...
use VB.NET and C#.NET code in the same C#.NET project
All-- Here is a sample that is "off the beaten path", (at least for me). Is it possible, in an ASP.NET application, using the code-behind page building technique, to have both pages written in VB.NET and pages written C#.NET?At http://www.WebLogicArts.com/DemoList.aspx there is a sample that shows that, (contrary to popular belief), it IS possible to mix ASP.NET pages built with C#.NET with ASP.NET pages built with VB.NET in the same VS.NET 2003 project. Note that this is just a "fun" sample to see if it can be done and I do not recommend this practice as a "standard" way of developing. The trick is to use the "Src" attribute of the @Page directive. Check out the link if you are inclined. You are welcome to download the code if you are interested further, found at the same link. (Note that the reason that I looked for a way to do this is because I wanted to have the option to include some VB.NET-based demos at my site. Since my site is a C#.NET ASP.NET, I was told that there was no want to do this. Therefore, I looked for a workaround and just happened to find one.) Enjoy (and then get back to work!) http://www.NetBrainer.com
you are right !!!mixing languages could cause unknow and uncontrolled problems !!! if a developer has to mix ....the practical way is to create a new project with different language and what will be absolutely fine !!!thanks mkamoski for raising this issue !!Fadil Alnassar www.fadilalnassar.com | FREE Nodil Tab Controlhttp://www.mefranchisi...
how can i write this line using vb.net : container.dataitem ?.... in vb.net its not working
Dim container As GridView = CType(newLinkButton.NamingContainer, GridView)
Dim dataValue As Object = DataBinder.Eval(container.dataitem, _ColName)
_ColName its just a string a name of the field in my database
This is Vb.Net code man what you want?
You can convert any format from this link
http://www.developerfusion.com/tools/convert/vb-to-csharp/
If this post is answer of your question then don't forgot to Click Mark As Answer...
Why does this work in VB.NET but not C#?
I'm using the Club Starter Kit and the issue is with the PageNumberer object that implements a WebControl. I've converted it to C# and have most of it working except for the PageNumberer object.
Here is the VB.NET code:1 Public Event SelectedPageChanged As EventHandler
2
3 Public Sub RaisePostBackEvent(ByVal eventArgument As String) Implements System.Web.UI.IPostBackEventHandler.RaisePostBackEvent
4 Dim newPage As Integer
5 If Integer.TryParse(eventArgument, newPage) Then
6
7 Me.SelectedPage = newPa...
Both C# ASPX pages and VB.NET ASPX in single VB.NET Web Applcation Template
Hi..
Is it possible to have both c# pages and VB pages in same Webapplication, what i chose is VB.NET Web application Template.
With Thanks,
Jaya....
I don't see why you couldn't, but for the sake of consistency I don't know why you would want to do this. When you choose a C# or VB.NET application template(I'm assuming you're using VS or WebMatrix), it simply creates a .aspx file that includes a page directive that specifies the page language. If you created a C# template but want to use VB.Net instead, you need to go from:
<%@ Page Language="C#" ....
to...
converting to vb.net from c#.net authorize.net
authorize.net offered me some sample code when I signed up with them the only problem is the sample code is in c#.net but my page that they type all of their credit card into is vb.net
<code><%@ Import Namespace="System.Net" %>
<%@ Import Namespace="System.IO" %>
<script language="C#" runat="server">
void Page_Load(Object Src, EventArgs E) {
myPage.Text = readHtmlPage("https://certification.authorize.net/gateway/transact.dll");
}
private String readHtmlPage(string url)
{
...
Access Net work mapped drive VB.NET
Hi
I have a docuemnt mangemnt system coded in VB.NET.
The system sometimes needs to get documents from Network mapped drive and shared drives. In development machine everything works fine. But when I moved the code to Test serever, it could not access the mapped drives. I tried all security settings. But still could not.
I tried unc path, but it throws In valid user exception.
Can anybody help m eto solve this issue.
Thank you
Jikk
Hi Jikk,
What login is your app running under? Whichever it is, it has to have permission to access the network, which ASPNET doesn'...
.Net 2.0 Web application using Vb.net is unable to create object of another dll writen in C# .net 2.0
Hi,
I habe created one ASP.net web application using Vb.net which is adding reference of dlls written in C# and .net 2.0. But whenever trying to create object of referencing dll, it is throwing error :Object reference does not set to an object. But, locally it is working fine,. In the server i have deployed the .aspx files and dll files in the bin. There were already an web.config in the server which is of .net 1.1. But checked it is retrieving value for that web.config correctly.
Should i have to deply any other files and if not what can be the solution for this? Please help.
Thanks,
So...
after installing web matrix VB.NET web page don't work
I just started with ASP.NET in VB.NET. I had developed a simple web page and it worked fine. Then I installed web matrix and started playing with it. When I go back to VB and try to run the program (that worked before) I get an error: "Unable to start debugging on the web server. Could not start ASP.NET or ATL server debugging."
How do I get VB.NET to working again?
I'm not sure why your existing Web application don't work after the installation of Web Matrix, as they can live without conflict in fact, did you try to look for an answer from the support.microsoft.com about the ...
COM works in VB.net, not C#??
I am converting a site from asp to asp.net. This site uses a COM object and I would like to use C#. I've included aspcompat=true in my page directive.
In VB.net, it works great.......Dim oLDS as ObjectoLDS = Server.CreateObject("ldswebapi.Lookup")oLDs.Initialize("C:\LDSDATA")In C#, not so great........Object oLDS = new Object(); // or Object oLDS;oLDS = Server.CreateObject("ldswebapi.Lookup");oLDs.Initialize("C:\LDSDATA");I get error "object does not contain a definition Initialize"
I don't get it. Can I not use C# for this?
jepatte
Yeah you can. The problem is that VB.NET is loose. The "object" object doesn't have a method called Initialize. Your object might, but because it is of type object, C# won't recognize it. It is like turning EXPLICIT and STRICT on in VB.NET. You would have to cast your object to a COM wrapper, or Invoke it with reflection.Cheers, Kevin JonesMy Blog
So what is an example of a COM wrapper or Invoke it w/ reflection?jepatte
you can add reference your com object in Visual Studio by right click on your project and select Add Preference. Select the dlls you want to use.
This will create an Interop dll.
You can try the following
using ldswebapi.Lookup;
ldswebapi.Lookup oLDS = new ldswebapi.Lookup();
oLDs.Initialize("C:\LDSDATA");
Hope this helps...
Catch events in javascript from .NET usercontrol works in VB.Net
I've created a vb.net Windows Forms control that I've got working hosted in IE using the implementation found here:
http://support.microsoft.com/default.aspx?scid=kb;en-us;305624
and here
http://msdn.microsoft.com/library/default.asp?url=/msdnmag/issues/02/01/UserCtrl/TOC.asp
I can access my properties and methods from javascript with no problem. I tried to raise events in my UserControl and catch them in the HTML with javascript but I couldn't get it to work. The second article above on msdn explains how to source events from C#, but I need to get it working in VB.Net. A...
vb.net vs c#.net vs j#.net
just out of curiousity which looks, acts most like java? i'm still learning trying to used to vb.net but it seems that it was easier to do some stuff with java.
C# is Java++ in my opinion. If you have done C or Jave you will prefer C#.Mike Schellenberger - MCAD
If you are looking for language similar to java go for J#.
However most code samples you find on the net will be in VB.NET and C#....
same exact code works in vb.net but not in C#
can any help me why the same exact code works in vb.net but not in C# . case is very simple
I have a table called MenuItems which has menu items and a table sizeandprice which has price for each menuitem based on the size. simple case of 1 to many relationship between menuitems table to sizeandprice table. I am trying to display in a gridview control couple of fields from menuitems table and have another template field in which i am display price and size field from the child table which is sizeand price. so basically this is how my code looks like
Page in vb works fine
<%@ Page Langu...
Change VB.Net string, so that it works in C#
Hi
Can someone help me to change this string, so that it works in C#?
html = "" & _
"<img src=""" & IMAGE_DIRECTORY & Path.GetFileName(s) & """" & _
"height=""" & imgHeight & """ width=""" & imgWidth & """ Border=""0"" name=""image" & intCounter & """>" & _
"<br>" & _
"<div align=center><span styl...
Trasaction problem (work in C# but not VB.NET)?
Hey!I am building a unit test project and have tryed the transaction in C# like this: using (TransactionScope oTranScope = new TransactionScope())
{
//work to be done
oTranScope.Complete();
} This workes grate even when the databas operations is deep down in a object. I have now moved on to imiplement this in a VB.NET project and the code for this is as fallows: Try
Using scope As TransactionScope = New TransactionScope()
lUpdateStaffResult = mainte...
C#.NET or VB.NET
what lang does everyone prefer?
Thanks, Peter Iuvara, MCP
It's a very famous debatable question in forums! I would say if you are from Java/C/C++, then C# would be easy to use for you. If you are from ASP/VB, then VB.NET would be easy for you!
As long as if you follow CLS, then what ever the language you use, it's going to be the same for CLR!Sreedharhttp://www.w3coder.orgweblog http://weblogs.asp.net/skoganti
I would agree with that ... just curious as to what user's on this forum predominantly code in?Thanks, Peter Iuvara, MCP
I came from no real programming background, started i...
vb .net or c# .net
I currently develop websites using php but have been requested to develop a site using asp.net. The question I have is for someone who knows php would it be better to transition to vb.net or c#.net?
Thanks,
Fr. Robert
C# -> There is a converter that will transition about 60% or more of your PHP code to C#. Plus C# is closer to PHP than VB.NET.Jason N. GaylordASPInsider and Microsoft MVPhttp://jasongaylord.com...
VB.Net To C#.Net
Hello...
Since Last from 1 year i had develope web application in using vb.net
now i want to transfer from vb.net to c#.net
so what should i do to transform to c# language any link or book related to me through
i can easily understand and coding using c# in a short time...
Thanks~ Mark As Answer If UseFull ~Kaushal.
Hi,
you can read the specifications of the language. You're already familiar with .NET and how to program in an OO manner thanks to your experience with vb.net. The only thing you need to learn is the new syntax of C#. You can also convert parts of your v...
Shell not working in web form but working with windows forms.
Hi!
I want to run some exe files (Exa: Internet explorer) using shell command in asp.net. Its not working if its a web form. But working fine with a windows form.
Pls. extend ur help.
Thanx.
What are you expecting to happen? How are you trying to run the exe files? Where do you expect it to run?
Anything run through server side code will run on the server, and in an invisible window, at that. The program will run under the security context of the ASPNET user by default, and so likely will not have the proper authority to do much of what you want, unless you midify its rights...
How To Convert c#2005.net web template to vb2005.net Forms Template
I need Convert c#2005.net web template to vb2005.net Forms Template
There are some free c# to vb converters out there which will allow you to upload a project and convert it to vb. The programming models for windows forms and web projects are very different there is no way to convert a web to windows forms project.
http://www.carlosag.net/Tools/CodeTranslator/Default.aspx
Silverlight-helpVb TipsSpace Coast .Net User Group
Hey Ajax-y,
This tool really helps all programmers. I thought I would share this with you in hopes that you will fine some use for it. Thanks to KamalPatel.Net for this tool. You can see the tool here. www.kamalpatel.net
Hope this helps!!
Please give us feedback no matter whether you get your answer.Please "mark as answer" if it's useful for youSincerely,SpongeBert...