.NET Programming





The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.

Share tech news, updates, or what's on your mind.

Sign up to Post

I read this article that says the release date of asp.net core 3.0 would be announced at the Microsoft Build conference.

I did not attend the conference.

Anyone know the release date?
What tools are needed for .net mobile device development and where can I find some really good tutorials?

I'm thinking Xamarin, since it's write once, and C#. Does it also allow VB.NET?

Is there a way to force a Control+F5 on a user? We publish our code and the style sheets look horrible until they do a control+F5, but other than putting a message on the screen, how do we trigger the style sheets to update?


I need to install Microsoft .NET Framework 3.5 on all Windows servers and I noted that there are some Windows 2003 are missing that version, they have Microsoft .NET Framework 2.0.

The reason why I need to install it is because a monitoring application required that to work.

My question is: Is there any impact to install it? I mean can this affect the applications already installed in the servers?

I recently upgraded from jQuery 1.11.1 to jQuery 3.0.0 and now  a simple change on a couple of radio buttons no longer works. How can I get this back to working as it should?

    <script type="text/javascript">
       jQuery(document).ready(function () {
            j$('#cmdCreateNewEvent').prop('disabled', 'disabled');

            $('#rdoSameDonor').change(function () {
            $('#rdoDifferentDonor').change(function () {

        function EnableCreateButton() {

Open in new window

We need to convert part of our MS Access DB to a web app.  ASPX or .net.  No experience in web apps.  Ideas?
I am try to take a 1 dimensional array of data and transform it to display in X number of columns each with X number of rows for each page into a datatable to easily display as the sample below shows. I am not sure the best way to do this.

Just to test the example I want 3 columns per page, and each column will contain 3 rows with the sample data below there should be 2 pages with 3 columns and a 4 page will have only 1 col and 1 row of data remaining.

samplearray= "{"100","110","120","130","140","150","160","170","180","190","200","210","220","230","240","250","260","270","280"}"

Example Output:

[Page #1]

[Column #1]     [Column #2]     [Column #3]
100                     130                    160
110                     140                    170
120                     150                    180

[Page #2]

[Column #1]     [Column #2]     [Column #3]
190                     220                     250                    
200                     230                     260                    
210                     240                     270                    

[Page #3]

[Column #1]     [Column #2]     [Column #3]

I have the following code. How can I avoid foreach using linq?

foreach(var number in phoneNumbers)
	foreach(var i in number.key)
		if(students[i].phone == null)
			students[i] = new People { phone = number.Value };
			students[i].phone = number.Value;

Open in new window

please note
Dictionary<string[], string> phoneNumbers
List<People> students
Hi Experts,

I am running on dot net 4.6.1

I have the same problem described in the following question


Please help ASAP,

I'm looking for a bit of hand-holding on setting up, what I thought would be a simple project.
I am using Visual Studio 2017 .Net 4.7.
I've done some coding in c# long ago, but am more comfortable in vb.net.
I had previously done quite a bit of winform development, and only ever dabbled in web dev.  Since it's been so incredibly long ago, I would like to have some guidance on starting this from scratch.

I plan to have multiple progression questions on this and I'll attempt to keep it limited to simple steps throughout.
For the first question on this, however, I need to describe what I'm envisioning:

I will have a user visit this single web page. There would be a title with a button/link to click for more info (detailed instructions located elsewhere in our intranet).
Page load would read a sql database to pull down a list of memberships for this specific user (I do have the working code to accomplish this).
Those results are then placed into a list box (I thought a checkedlistbox would be best).  

The user is then given the following options:
A button, always available, to CREATE.
A button, only available if one, and only one item is selected, to MODIFY.
A button only available if one or more items are selected.  This button should present a confirmation, since this would be a delete process to occur.

I'd like to use bootstrap because I did spend a bit of time learning a bit about it, but I have very little knowledge on how to implement it into my code.
I recently had a pen test and one of the findings was our OWA (exchange 2013) is vulnerable to "Possible SQL Injection". Our pen tester recommends us to download the latest login dialog applet from Microsoft or recompile the web code against the v4.5 or later .NET framework. I am not able to find any download in Microsoft nor can I find any information regarding vulnerability or how to remediate it.

Has anyone encounter this issue before or know how to secure the OWA's logon page from SQL Injection? I read somewhere that it is not recommended to edit Microsoft's code.
Using Framework...
     ASP.NET Regular Web Form

Using Code Behind...
     VB.net & JavaScript & JQuery

My Issue...
I Need VB.code replacement for the following JavaScript Function --
(JavaScript Function may not be Syntactically Correct Since I Slightly modified its structure)
function myFunc(RBG) {
   var rbGrp = RBG; 
   var myVal;
   var radioButtons = document.getElementsByName(rbGrp);
      for (var x = 0; x < radioButtons.length; x ++) {
        if (radioButtons[x].checked) {
	     myVal = radioButtons[x].id);
             return myVal;

Open in new window

This JavaScript Function is PASSED the GROUPNAME of a group of Radio buttons...

It loops thru all the individual radio buttons of that Group of buttons via that GROUPNAME...

and ihen it should return the one radio button that was selected...

I need this in Server Side vb.net code instead of client side JavaScript code...

I have already laid out 35 Groups of Radio buttons each with 2, 3 or 5 individual choices -- already built in my ASP.net form so doing Radio Button List is now past as option

Any Experts have or can create this vb.net code equal to the JS code ??

thanks... CJ
I need the best practices on securing patients records inside the electronic medical record app I am developing. Ground from the database tier up to the presentation tier.
I currently have a getresults() function which returns a dataset . I bind that result to a datagrid . all of this works fine ( see sample below) .

DataSet dataset = getResults(); //retruns a data set

MyDataGrid.DataSource = dataset.Tables[0].DefaultView;

I want to filter the results that is returned from getresults function before I bind it to the DataGrid, and was thinking to use linq ,

var result = getResults();

var filteredResults = from x in result.Tables[0].AsEnumerable()
                                   orderby x.Field<DateTime>("lastUpdated") ascending
                                   select x;

this query works and I get the filteredResults as desired, but now how do I bind this to the DataGrid. Also, how do I take the first 20 , from the result?
This kind of code delete all files in directory if cheked

          If chkDeleteSourceFiles.Checked Then
                For i As Integer = 0 To oFiles.Length - 1
                    Dim sFromFilePath As String = oFiles(i)
                    If IO.File.Exists(sFromFilePath) Then
                        Catch ex As Exception
                            txtOutput.Text += "No se puede borrar " & sFromFilePath &
                             ", " & ex.Message & vbCrLf
                        End Try
                    End If
            End If

Open in new window

That is a mess...
I need if is cheked only delete PDF files.
could you help me ?

I am a lab instructor at my university doing Data modeling and programming languages classes.

I need a roadmap for my students who want to learn .net programming using c# from zero to hero.

Topics, Curriculum, Frameworks, ....

Please help me and my students!
I need to use HTML encode to filter/scrub some data being read by my SqlDataReader object. Trying to prevent an XSS attack. I've never used HTML encode before but I need to apply it to code that looks like the following:

                        oReader = oCmd.ExecuteReader();

                    if (oReader.HasRows == true)
                        int iLastID = 0;
                        decimal total = 0;

                        while (oReader.Read())
                            if (iLastID != oReader.GetInt32(oReader.GetOrdinal("checktypeid_fk")))
                                sTableDetail += "<tr>";
                                sTableDetail += "<TD>" + oReader.GetValue(oReader.GetOrdinal("Description")).ToString() + "</TD>";
                                sTableDetail += "<TD>" + oReader.GetValue(oReader.GetOrdinal("Quantity")).ToString() + "</TD>";
                                sTableDetail += "<TD align=right>$" + oReader.GetValue(oReader.GetOrdinal("Amount")).ToString() + "</TD>";
                                sTableDetail += "<TD align=right>$" + Convert.ToString(Convert.ToDouble(oReader.GetValue(oReader.GetOrdinal("Amount"))) * Convert.ToDouble(oReader.GetValue(oReader.GetOrdinal("Quantity")))) + "</TD></TR>";

Open in new window

I'm looking for a bit of guidance and suggestions with regard to a good approach for a nightly batch process on the database of a web based system.

We have developed a C#, MVC, SQL Server, Entity Framework, IIS web solution and that is working well.  We now have a need for some nightly processing to occur, which will be all related to the database.  Basically reading certain tables, looking for certain conditions, and updating / adding data as needed.  Processing should not be large so I don't think load on servers or database is an issue, and that isn't the focus of this question.

What I'm looking for is best practice suggestions for implementing this overnight processing solution?  We use TFS to manage out development projects and Visual Studio as our development environment, along with SSMS.  I'd like to use C# and leverage Enterprise Framework if possible.  Should this just be a stand alone EXE that is scheduled to run nightly in Task Scheduler?  Or should we use something like SSIS (even though we aren't importing or exporting, just updating some existing tables and data)?  Or are there other techniques I should be considering?  What factors enter into my decision?

Should this be part of the web site solution in TFS, or should it be a whole new solution?

I'm sure there may be more info needed for quality feedback, but I hope this gets the dialog started.  I appreciate all help and guidance.

I'm getting some file info in my application and i'd like write them if have relative directory relationship in my application.

For example my directory: C:/files

If it's found file in;
C:/files/test1.pdf    'Output: ../test1.pdf
C:/files/190501/test2.pdf 'Output: ../190501/test2.pdf
C:/archive/180501/test3.pdf 'Output: C:/archive/180501/test3.pdf

I search on net and Path.GetRelativePath would fit my desire but it's not supported at .net 4.8 so Any help would be grateful.

I am trying to call a stored procedure in C# that contains both SELECT statements and PRINT statements. I've managed to get the PRINT statements back by way of a SqlInfoMessageEventHandler, but that doesn't help since there are SELECT statements mixed in that contain information pertaining to the PRINT statements.

The other fun part of this is that the SELECT statements all have varying #s and names of columns.

All I really want to do is capture all of that output into a string variable (kinda like executing the stored procedure in SSMS with the query results being output as text.

Changing the Stored Procedure isn't possible.

Is this possible?
I have an  asp.net web forms website. I have two aspx pages ( say abc.aspx and xyz.aspx)   right now in my project. Right now, I have a navigation menu , to go to each of these pages , but instead of that I want to combine the two navigation item, into one had inside that page, I want to have tabs so that i can switch between the two aspx pages.

I looked into asp multi view tutorial (see below).

one thing  I am wondering about is , if I have this asp: multiview implemented, then I will have to combine both of the abc.aspx.cs and xyz.aspx.cs file into one cs file or
combine both back end code into file. is there a way, instead of doing that I can keep the two files and separate and load just the content based on which tab is clicked?

<asp:MultiView     ID="MultiView1"  runat="server"   ActiveViewIndex="0"  >
   <asp:View ID="Tab1" runat="server"  >                              TAB VIEW 1             </asp:View>
    <asp:View ID="Tab2" runat="server">                               TAB VIEW 2             </asp:View>
I am developing on-premise Electronic Medical Records (EMR) app for a clinic.
I architected the solution using Domain Driven Design approach combined with the following architectural styles:
  • Layered architectural style: for structuring the solution and separation of concerns
  • 3-Tier architectural style: for deployment
  1. Database tier: Sql Server database
      [list=2]Application server tier[/list];
      [list=3]Presentation tier as a desktop app[/list].
  • SOA architectural style: for the communication between the desktop app and the application server; Where the application server exposes the business services.

I have the following error on the application server when I tried to access the WCF security service from the web browser:

"The message with Action '' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver.  Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None)."

Attached the solution source code.
WordPress and Azure?

I hope to create a WP site as a hobby, since I just never got around to learning PHP. But, as a .NET Developer, I also want to get my hands dirty with Azure.

Does it make sense to do this? Eventually, I would expect to host the WP site, but have no idea of what it might cost to so this. I mean, host WP on Azure.

Any idea what it might cost for a low-traffic WP podcast hosted on Azure?

Or, if this is a really bad idea, please tell me.

I want to pass a datatable to a stored procedures.  I found the below article and have been using this as my template.


I created the below Type successfully but when trying to use it in the stored procedure I'm getting below error.

Msg 137, Level 16, State 1, Procedure POProcess, Line 31 [Batch Start Line 7]
Must declare the scalar variable "@POC".

How do I fix this?

	[id_PO] [int] IDENTITY(1,1) NOT NULL,
	[promisedDate] [datetime] NULL,
	[qty] [int] NULL

Open in new window

ALTER PROCEDURE [dbo].[POProcess] (
	@POC POComponentType READONLY
) AS

	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.

		UPDATE POComponent
		SET promisedDate =	@POC.promisedDate,
		qty =				@POC.qty
		WHERE id_PO =		@POC.id_PO


Open in new window

I have a general question about the effectiveness of encrypting column(s) in SQL.
So you have a column or more that you have encrypted during the creation of a table.  Prior, of course, you create a Master and Private Column Encryption keys.  
The encryption and decryption takes place in the .NET application that connects to the database.  The Private Key created in the SQL database is exported and imported onto the machine running the .NET application.

My question is this ..
What prohibits someone, a developer, with this certificate from creating their own .NET application to access the data in the encrypted columns of the database, if they have access to that database; for instance a DBA.  The whole idea is not only encrypt the data from unauthorized access; but to also keep DBA's from viewing it as well.

.NET Programming





The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.