Here is a small function to return the GUID. GUID stands for Globally Unique Identifiers. GUIDs are 128-bit globally unique identifiers and they are generated automatically based on close to two zillion frequently varying factors. It has extremely low possibility that a generated GUID would equal to another GUID. Function GenerateGUID() as string return System.Guid.NewGuid.ToString() […]
Error Provider is a cool control which provides visual indications of any errors which you catch. eg. If you have a text box which is supposed to captured the names of people and if someone leaves it blank you can use Error Provider to provide a visual indication of the error. Here is […]
If you would like to hide the columnheaders of a datagridview in your winforms application then here is the code for that. ‘ This will hide all the column headers for your datagridview In VB.NET use this code DataGridView1.ColumnHeadersVisible = False In C# use the following code dataGridView1.ColumnHeadersVisible = false;
Scenario: If you have two controllers with the same name in different areas, then you would end up with errors as shown below, while there are numerous examples available on the web but it took me a while to figure out the correct solution for VB. Hope it help you and saves you time. Problem […]
VB.NET – You must call the “WebSecurity.InitializeDatabaseConnection” method before you call any other method of the “WebSecurity” class.
Problem description: If you are getting the error while running your MVC4 application in VB.NET You must call the “WebSecurity.InitializeDatabaseConnection” method before you call any other method of the “WebSecurity” class. Solution Add the following line in the GLOBAL.ASX Ensure that you are using the correct connection string and other information as per your […]
Here is a simple way to do the role based Authorization in your MVC4 Controllers using VB.NET IF you have a role called Client then simply add the following text on top of your each ActionResult( which displays the view) <Authorize(Roles:=”Client”)> See the following example. The Index View has been restricted and can only […]
I realised that in my MVC5 project in Visual Studio I could not get the Ajax.BeginForm to work properly. It will always do a full postback. I was trying to complete a Video Rating Page, where there are buttons to rate a video and once the user presses one of the rating button, it […]
In VB.NET Use tablControl1.SelectedTab = MyTabName In C# use tabControl1.SelectedTab = MyTabName; MytabName will automatically be displayed.
There is often a need to pass a variable from one Winform to another. There are two scenarios Let us say you have two forms 1. You opened Form1 and then you want to open a new form called Form2 and you would want to carry some information from Form 1 to Form2. The user […]