|
Hi,
Actually it depends up on your taste. Because using both you can develop good applications in asp.net. Although I use c# only but it is again my own preference. Here are some points which has been given by other person(in code project some time back) on why to use C#:
This isn't a slam on VB.NET, but rather, some positives about using C# instead of other .NET languages:
* It's at the forefront of research: most of the language innovation at MS Research is being poured into C#, trickling down to other languages: generics, language integrated query, lambda expressions, expression trees, continuations, extension methods, heck, the whole .NET FCL was written in C#. As it usually goes, other languages get these features trickled down to them, but C# is at the fore.
* The primary language: being the primary .NET language has its perks, such as tools that only work with C#, a majority of books on .NET are C#-based, demos, examples, even tools like the recently released XNA Game Studio are C#-only.
* C#, Java, C++, hey, even Javascript languages transition to one another far more easily than the verbose VB.NET. This means more devs are likely to understand your code, simply because of the fact they are all based on C-like syntax.
* No supporting libraries: VB.NET uses the Microsoft.VisualBasic library and other supporting libraries that bring a lot of ugly cruft over from VB6. No such thing in C#, and is another reason why some .NET tools won't support VB.NET. Again, look at the recent XNA Studio; you can't write VB.NET code on the XBox360 because those extra VB dependencies haven't been ported to the XBox360 platform.
* A fresh start. Unlike VB.NET, we don't have ugly, non-conforming libraries brought over from the old world of VB6, and all the bad practices that originated there.
* C# can do some things VB.NET can't easily do. Need to load a private font? Need fast access to a bitmap's pixels? Need to interop with pointers? All those things can be done natively and easily in C#, but require rather bloated work-arounds in VB.NET.
A private font? Say you've got a great font for your client app. But the font may not be installed on the end-user's system. You *could* embed the font as an app resource, but then you'd have to copy the font into %windir%\fonts directory, and that requires administrator priveleges, not to mention lots of disk access.
What you can instead do is embed the font as a resource in your app, then load it and use it in your app without having to install the font on the target system. This is accomplished through System.Drawing.Text.PrivateFontCollection object. The reason it's difficult to do in VB.NET is becausing adding a font to the private font collection object from an in-memory font requires an IntPtr to the memory location of the font. C# can do this no problem since we can use pointers, VB.NET has trouble doing this; having to resort to using the interop wrappers in the System.Runtime.InteropServices namespace.
Hope you will get some idea with this.
Best Regards,
Apurva Kaushal
|
|
|
|
|
difference between session and application variabels
|
|
|
|
|
Session variables remains for a particular session and application variable will be available for the whole application. Means if you put some thing in an application variable then it will be available across the application for all the users.
Best Regards,
Apurva Kaushal
|
|
|
|
|
I have two web user control. One for Login and another one for Signup. I use both controls in one page. I load both control on Page_load event and then hide and show these with the help of radio button. But problem is that When I click a button in Login control or in Signup control the validation control of both controls get active.
I want that Only one control's validation controls are get activated at one time. Is this possible that I use two form tag in one page.
Can u help me. All these coding is done in ASP.NET with C#
Manish Kumar
Software Developer(.NET)
|
|
|
|
|
You have deactivate the validation on click of the radio button what you are already doing to show and hide. If you are using asp.net validation control then disable it on change of radio button selection.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Hi
When i am using cross page posting i a getting an error.
Unable to cast object of type 'ASP.Orders_aspx' to type 'ASP.Orders_aspx'.
Most of the time page works cools . This error arise in an irregular manner.In the Previous page i used a linkbutton to do Crosspage posting.
Thanks in advance.
|
|
|
|
|
|
Thanks for your reply.
Mentioned error is showing randomly. Yet i am confused with the context it getting error.
|
|
|
|
|
Can you debug with the Express Edition. I keep getting an error everytime I try to do it. Anyone know of any news groups that have visual studio 2005 pro?
|
|
|
|
|
Hi,
Tell what error u get when u debug.
With Regards
Satips
|
|
|
|
|
It just says server doens't allow debugger in asp.net .
|
|
|
|
|
hi,
I need to open popup window base on already popup Dialog.I m using C#,ASP.NET,JavaScripts for Web Application..
Can any one help me?
Thanks in Advance.
|
|
|
|
|
just use window.open to open another window
Mahendra
|
|
|
|
|
Hi all,
I'm playing around with Microsoft SharePoint (2.0) and I'm going through some examples in the SDK. I'm at a step which describes using Visual Studio .NET to create a new Web application on the SP server side. I've run into a problem which doesn't seem to be very well covered on the net.
Unable to create the web "http://server/_layouts/SPTest". Server error: The folder "_layouts/SPTest" is reserved for use by the Web server. A Web may not be created under this URL.
I'm running Windows XP and attempting to connect to the SP server, which is a separate Windows 2003 machine.
I've had a look at this link as it describes my problem, but in my case I don't get any errors in the event log both on the server and client side. So I'm guessing the solution will be somewhat different.
Has anyone encountered this? How do I solve this problem?
Thanks in advance,
Sam
|
|
|
|
|
I have a receiving form with a dropdownlist bound to an employee table. The list items are filtered to show only active employees. If I go to an old record from years back where the employee is now inactive and no longer in this filtered list an error will be thrown because the value is not in the list.
So far advice given has been don't deactivate employees, don't use dropdownlists, or don't use databinding. Does anyone have any real answers? Preferably, I'd like the dropdownlist to show an empty value instead of crashing. Is it possible to write a control adapter to prevent this behaviour?
|
|
|
|
|
Why cant u write a query like this
string strcmd="select * from emp table where status='active';
DataAdapter da = new DataAdapter(strcmd,con);
DataSet ds = new DataSet()
da.fill(ds,"emp");
ddl.DataSource=ds;
ddl.DataTextField=ds.Tables[0].["ur columnname"];
ddl.DataValueField=ds.Tables[0].["ur columnname"];
So that ur ddl will bind only active employees.
|
|
|
|
|
I have an ASP.NET (C#) website that works perfectly on my local system. When I upload it to my web host it used to work fine, however after some updates i re-uploaded it and got an error 'XML Parsing Error: no element found' (in Firefox only, IE displays a blank screen). The update I did was rather large so I really have no idea where to start, it would be almost as quick to start the website again (it is still in the making). Does anyone have a hint of an idea what to do? =]. I realise I haven't given much information here but I dont know what is causing this error so I don't know what to give. Some general information: using masterpages, each page is inheriting from a single class which in turn inherits from System.Web.UI.Page, every file is using codebehind and I am using an MS Access database.
Here is the URL: http://www.maximusbrood.com/sc/
Any help is much appreciated. Thanks.
FinnG -
|
|
|
|
|
You didn't mentioned about where you are getting that error i mean in STARTUP page or any other.
If startup page
-Make sure that there are no errors in web.config file
-If you are using xml file(loading) in Master page make sure that xml file is well formed.
-If you are using Resource File make sure that it is well formed.
Final Suggestion is you can debug in master page by catching that error line.
|
|
|
|
|
Hello,
I have two tables in an Access database: content and content_localized which are related.
I created a query:
SELECT content_localized.content_html
FROM content INNER JOIN content_localized ON content.content_id = content_localized.content_id
WHERE (((content.content_page)=[@Page]) AND ((content.content_name)=[@Name]) AND ((content_localized.content_culture)=[@Culture]));
I tested it in Microsoft Access and it is working fine.
Then I tried to retrieve its value from my web site but nothing shows up.
I am using the following code:
' Set Connection
Dim connectionString As String = ConfigurationManager.ConnectionStrings(_ConnectionString).ConnectionString
Dim connection As System.Data.IDbConnection = New System.Data.OleDb.OleDbConnection(connectionString)
' Set Command
Dim command As New System.Data.OleDb.OleDbCommand
command.CommandText = "content_SELECT"
command.Connection = connection
command.CommandType = CommandType.StoredProcedure
' Add Parameters
command.Parameters.Add(New OleDb.OleDbParameter("@Culture", _Culture))
command.Parameters.Add(New OleDb.OleDbParameter("@Page", _Page))
command.Parameters.Add(New OleDb.OleDbParameter("@Name", _Name))
' Execute the Command
connection.Open()
Dim contentHtml As OleDb.OleDbDataReader = command.ExecuteReader
If contentHtml.Read Then
Return contentHtml.Item("content_html").ToString()
Else
Return "Error" ***
End If
contentHtml.Close()
connection.Close()
My function returns "Error" from line ***
Does anyone has an idea what might be wrong?
Thank You,
Miguel
|
|
|
|
|
Please share exact error, then may be i can help you. In the meantime
try to change If contentHtml.Read Then to "While contentHtml.Read"
Thanks
|
|
|
|
|
Hello Amit,
That is the point. I don't get any error.
Well, at least I am not seing it.
I also tried with "While..." and I get no returned value.
I tested the query, in Microsoft Access, with the parameters values which I show here and I get one result. However, my function doesn't return anything with those values.
The code I have now is as follows:
Public Function Load()
' Set Connection
Dim connectionString As String = ConfigurationManager.ConnectionStrings(_ConnectionString).ConnectionString
Dim connection As New System.Data.OleDb.OleDbConnection(connectionString)
' Set Command
Dim command As New System.Data.OleDb.OleDbCommand
With command
.CommandText = "EXECUTE content_SELECT"
.Connection = connection
.CommandType = CommandType.Text
End With
' Add Parameters
With command.Parameters
.Add(New OleDb.OleDbParameter("[@Culture]", "pt-PT"))
.Add(New OleDb.OleDbParameter("[@Page]", "Default.aspx"))
.Add(New OleDb.OleDbParameter("[@Name]", "Newsletter"))
End With
' Execute the Command
connection.Open()
Dim contentHtml As OleDb.OleDbDataReader = command.ExecuteReader
If contentHtml.Read Then
Return contentHtml.Item("content_html").ToString()
Else
Return "Not Found"
End If
contentHtml.Close()
connection.Close()
End Function
Any idea of might be going on or a way to try to figure this out?
Thanks,
Miguel
|
|
|
|
|
I am needing to create WebParts for SharePoint Services using VS 2005 Pro. I currently do not have Microsoft.SharePoint.dll on my PC as I am running XP and not server 2003.
My first question is: Is it possible to create webparts for sharepoint services using VS 2005 Pro because all the articles i could find were mentioning using Microsoft.SharePoint.dll with VS 2003.
Secondly, can I create user control (.ascx) and use it in SharePoint Servics?
Any help will be appreciated. Thanks.
|
|
|
|
|
hello
someone can help me
someone know article that help me to make a good data access layer use data access application block
i know how encapsulation this part is very important i wish to learn how encapsulation
encapsulating common functionality so i will reduce the number of lines of code in me DAL
thanks for the time
|
|
|
|
|
|
thank i will be check the article
|
|
|
|