.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Hi,When i try to convert this VB code in code converter i cannot convert to C#?.can any one help me

Posted By:      Posted Date: October 14, 2010    Points: 0   Category :ASP.Net

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        ' it is update procedure
        Dim upd As String = "Update order1 set status = '" + DropDownList1.SelectedValue + "' where ocod = '" + DropDownList2.SelectedValue + "'"
        'Dim str As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data source = c:\dms.mdb"
        Dim str As String = "Pr

View Complete Post

More Related Resource Links

Want to convert the code from c# to asp

  1.  WebRequest myWebRequest = WebRequest.Create(URL);  
  2.                 WebResponse myWebResponse = myWebRequest.GetResponse();  
  3.                 Stream ReceiveStream = myWebResponse.GetResponseStream();  
  4.                 Encoding encode = System.Text.Encoding.GetEncoding("utf-8");  
  5.                 StreamReader readStream = new StreamReader(ReceiveStream, encode);  
  6.                 string strResponse = readStream.ReadToEnd();  
  7.                 Response.Write("Response from site"

convert to vb.net code

can any one convert this code to vb.net code please HtmlForm form = (HtmlForm) this.FindControl("Form1"); foreach (Control ctrl in form.Controls) { If (ctrl Is TextBox) Then ((TextBox) ctrl).Text = string.Empty; ElseIf (ctrl Is DropDownList) Then ((DropDownList)ctrl).SelectedIndex = 0; } thanks  

Convert VB Code to working C# code

Hello. I am a beginner and I'm trying to work my way through the MSDN  beginner tutorials. The lesson I am working on had to do with transferring info to another page using a Session object. The example video is written in VB code. I tried to write this part of the lesson in C# code and where the VB code works I am getting an Error message in C# code saying 'The name 'Session' does not exist in the current context' and hence the program will not compile. here is VB Code on default.aspx page     Protected Sub nextButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles nextButton.Click     Dim bill As New Billing bill.FirstName = firstNameTextbox.Text Session.Add(   "billingInformation", bill) Response.Redirect(   "SessionResult.aspx") End Sub VB SessionResult.aspx code is:     Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load     Dim bill As Billing = Session("billingInformation")     Dim sb As New System.Text.StringBuilder() sb.Append(   "First Name: ") sb.Append(bill.FirstName) sb.Append(   "<br>") Response.Write(sb.ToString())     End Sub My C# code looks like this for default.aspx page and SessionResult.aspx page &nb

convert client vbscript code to server side

Hi There, we have some .htm pages with client side vbscript,the code is pasted below, we want to get this page run on the server side so that we can access this from a URL, can you please advice how convert this code to be able to run on the server side. Client side code: <HTML><HEAD><TITLE>Select Module</TITLE> <SCRIPT LANGUAGE="VBScript" ><!--     Option Explicit        Dim College    Dim Modules    Dim ModulesArr    Dim counter    Dim MyModules         Set College = Top.App.ActiveCollege    Set Modules = College.Modules     'Sorts the ModulesArr Array by module name.    Sub SortModules(StartPosition, EndPosition)        Dim I, J        Dim CurrName, CurrIndex        For I = StartPosition to EndPosition            J = I            CurrIndex = ModulesArr(J, 0)            CurrName = ModulesArr(J, 1)             'while Mod

convert asp.net code to diagram

it is very hard to read exist asp.net code. but view diagram is very easy. please explain about convert asp.net code to diagram.

convert image to rtf code

how can i convert image to rtf code

convert MVC Contrib code to VB


hi sorry for my bad english

this code for grid for MVC Contrib code project with C#

<%= Html.Grid(Model.People).Columns(column => {

      column.For(x => x.Id).Named("Person ID");

      column.For(x => x.Name);

      column.For(x => x.DateOfBirth).Format("{0:d}");


        .Attributes(style => "width:100%")

      .Empty("There are no people.")

      .RowStart(row => "<tr foo='bar'>") %>

i want translate(convert) it to VB.net ! can you help me ?

convert code vb.net to c#.net


Please somebody give idea to convert this code from vb.net tp c# .net.

i converted but not understand about namespace which namespace are added , please help me


 Response.ContentType = "application/pdf"
            Dim doc As Document = New Document
            PdfWriter.GetInstance(doc, New FileStream(Request.PhysicalApplicationPath + "\2.pdf", FileMode.Create))
            PdfWriter.GetInstance(doc, Response.OutputStream)
            Dim maintable = New PdfPTable(1)

            maintable.DefaultCell.BorderColor = iTextSharp.text.BaseColor.BLACK
            ' maintable.DefaultCell.Height = Convert.ToSingle(306)

            'maintable.DefaultCell.PaddingTop = 10


Convert code from C# into VB


I have tried a few code converters but they haven't worked. Can anyone help out? Thanks for your time!


void timer_Elapsed(object sender, ElapsedEventArgs e)
			canvas1.Dispatcher.BeginInvoke(DispatcherPriority.Background, new DispatcherOperationCallback(delegate(Object state)
				var node = textBlocks.First;
				var lastNode = textBlocks.Last;

				while (node != null)
					double newLeft = Canvas.GetLeft(node.Value) - move_amount;

					if (newLeft < (0 - (node.Value.ActualWidth + gap)))

						var lastNodeLeftPos = Canvas.GetLeft(lastNode.Value);


						if ((lastNodeLeftPos + lastNode.Value.ActualWidth + gap)> canvas1.Width) // Last element is offscreen
							newLeft = lastNodeLeftPos + lastNode.Value.ActualWidth + gap;

Convert code for GridView to work in DetailsView


Can anyone help me out please ?  I want this code to work in a DetailsView -

protected void gvContacts_RowDataBound(object sender, GridViewRowEventArgs e)
        if (e.Row.RowType.Equals(DataControlRowType.DataRow))
            DropDownList ddlGroupName = (DropDownList)e.Row.FindControl("ddlGroupName");
            Label lblGroupName = (Label)e.Row.FindControl("lblGroupName");
            lblGroupName.Text = ddlGroupName.SelectedItem.Text;
            ddlGroupName.Visible = false;

Thank you in advance

Convert Windows Application into Web Application with Code


Dear All,


I have a Windows Application and i got a requirement to convert all forms in Windows application to Web Application including code written in windows application. How can we do this. please do needful...

i have a code in asp, I have no idea how to convert it to asp.net (vb.net)


function mpCheckPass(userId, contentId, password) 

     urlStr = "http://www.micropay.co.il/ExtApi/PassCheck.php" 
     requestStr = "?get=1&uid="&userId&"&cid="&contentId&"&pass="&password
     Set httpCon = CreateObject("WinHttp.WinHttpRequest.5.1") 
     httpCon.Open "GET", urlStr & requestStr 

     result = cstr(httpCon.ResponseText) 
     if (isNumeric(result)) then  
          mpCheckPass = result 
          mpCheckPass = 0 
     end if 
end function

it has to send data to a url and get an answer.


convert c++ code to c#

Hi everyone, is there a utility to convert c++ code to c#? I have a .cpp file and a .h file that I would like to convert o C#. Thanks, Imad

Want to convert the code from c# to asp

  1.  WebRequest myWebRequest = WebRequest.Create(URL);  
  2.                 WebResponse myWebResponse = myWebRequest.GetResponse();  
  3.                 Stream ReceiveStream = myWebResponse.GetResponseStream();  
  4.                 Encoding encode = System.Text.Encoding.GetEncoding("utf-8");  
  5.                 StreamReader readStream = new StreamReader(ReceiveStream, encode);  
  6.                 string strResponse = readStream.ReadToEnd();  
  7.                 Response.Write("Response from site");  <

Help in convert a PHP code to ASP.net


Please I dont know php, I need some help to convert this code to asp.net.

Thanks so much


Eduardo Morgan


class Formbuilder {

	 * @var array Contains the form_hash and serialized form_structure from an external source (db)
	 * @access protected
	protected $_container;

	 * @var array Holds the form source in raw array form
	 * @access protected
	protected $_structure;

	 * @var array Holds the form source in serialized form
	 * @access protected
	protected $_structure_ser;

	 * @var array Holds the hash of the serialized form
	 * @access protected
	protected $_hash;

	  * Constructor, loads either a pre-serialized form structure or an incoming POST form
	  * @param array $containing_form_array
	  * @access public
	public function __construct($form = false){

		$form = is_array($form) ? $form : array();

		// Set the serialized structure if it's provided
		// otherwise, store the source
		if(array_key_exists('form_structure', $form)){

			$this->_container = $form; // set the form as the container
			$this->_structure_ser = $form['form_structure']; // pull the serialized form
			$this->_hash = $this->hash(); // hash the current structure
			$this->_structure = $this->retrieve(); // unserialize the form as the raw structure

.net code converter

For coverting your programming langugae to another languge the below site is very help full


Convert .docx to web page - "the converter cannot complete the task because an internal error occurr


I'm trying to convert docx files to webpages to be published in to a library elsewhere on our sharepoint site. At first I was having no problem, the files were converting, however more recent files have returned the error: the converter cannot complete the task because an internal error occurred

I've tried writing, uploading and converting a simple docx file, and this works which has led me to believe that the problem is something in the docx files that i'm trying to convert. So i tried using word07 to clean the documents up by clicking Office button>prepare>inspect document then removing all the metadata, custom xml etc from the files resave, upload and convert, but still no joy.

I'd simply rewrite the document but the problem is that there are a lot of them.

Any ideas what's going wrong?

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend