.NET Programming

133K

Solutions

38K

Contributors

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'm getting below error when i compile the c# project in vs2017

Formboca.resx due to its being in the Internet or Restricted zone or having the mark of the web on the file. Remove the mark of the web if you want to process these files
0
Cloud Class® Course: CompTIA Healthcare IT Tech
LVL 12
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

1. I'm following this example http://jsfiddle.net/glebkema/73gtkvjt/
that I got from here. I'm doing the jquery version Example

2. You can download my sample code here. Unzip and just click on "page.html" to see it. The js file is Reporting.js
https://drive.google.com/open?id=17IuFhPlYPX5B7EATvE9sDES-EoB3i7gA

This is what's happening

1. I click on "Add Report Delivery" button and I see the control displayed. I click on the purple div and I can hide and display the control. This works.
j1.png
2. Click on "Add Report Delivery" again and you'll see the second control. Now, click on the puruple div and that div (control) doesn't collapse. I put debug steps in the JS code and for the second puruple div...the js code is not even called. Only the first div collapses and expands. I see I have unique Ids . Not sure what I'm missing.

j2.png

EDIT I ran a test. When I click on "add delivery schedule", the control is built dynamically. Something with this dynamic control that the "click" control on "toggle" doesn't work. Don't know why.
0
Which on is the best tool for mobile web applications/apps (Python or Java or asp.net)
0
While attempting to install .NET Framework 3.5 (includes .NET 2.0 and 3.0) I get an error message that says "The changes couldn't be completed. Please reboot your computer and try again. Error code: 0x800F0950).

I have rebooted the laptop several times and continue to get this error message.

This happens if I try to install .NET Framework 3.5 through Windows Features, if I download the installer, or if I download the offline installer. This also happens no matter which user I am logged on as.

What can I do to fix this issue so I can successfully install .NET Framework 3.5?

.NET framework 3.5 error
0
What are the big benefits of .NET CORE?

And how do they differentiate from .NET Framework?
0
Design Pattern for object oriented design question...

What is that 5 letter word that has 5 OOP Design Patterns in that one word?

Once I hear the word, I will recall the 5 patterns.

"S," is Single Responsibility..

Thanks.
0
I have a Excel Workbook with a start form included.
I want to write a .net Form (more features as excel form) to handel Datas in a worksheet.
When i start the .Net form ..it connects correctly to the excel workbook, but the code is stoping because the startform comes up and
blocks all handling an the worksheet data.

How i can close the form from .net (VB/C#)?
or
how to start excel from .net with parameter /automation?
0
Hello,

I want to create desktop application using C# .NET that create RAR file. application select date wise files and create one RAR file of that.

Is there any utility or third party tool available ?


Thanks,
Naitik Gamit
0
I have an ASP.NET web forms project, currently running in .net 4.5 version. I am trying to migrate the source code to bitbucket. I pushed the code and compiled the project successfully. when I try to run the project, I get an runtime error shown below -

Could not load file or assembly <add assembly="System.Web.Helpers, Version=2.0.0.0, Culture=neutral  ....

In the project, under references I see system.web.helpers.dll, but the inside the folder  (C:\documents\repos\myproject\bin\System.Web.Helpers.dll )  the dll is not there.

when i go to nuget package manager , and search for system.web.helpers.dll , I can't find it.

Questions -

1. Is this dll no longer available and is replaced by something else?
2. I suppose, when the project was created initially, a reference to dll was added to the project. and looking at the folder path for the dll in the project ( C:\documents\repos\myproject\bin\System.Web.Helpers.dll), when i did a clean build the dll must have been deleted . when the dll was added initially, was it supposed to be in the bin folder?
3. or was this dll availabe in older version of .net ? if i update the .net framework version, I would probably need to update other dlls too, which I am trying to avoid.
4. what are best practices in such situations?
0
I'm confusing myself by going back and forth and reading about DataTable and jqGrid.

This is my dilemma:
1. Working on a project that has lots of grids. Grid.MVC is used for the grids
2. There's one section that uses jqGrid. Probably it's because "grouping (group by)" is needed (our  ex-developer coded this).
3. I bought this template  https://keenthemes.com/preview/metronic/theme/admin_1/table_datatables_managed.html and it uses DataTable (not that I can't replace it)

This is what I need
1. "Group by" for at least one section of our site
2.  Inline edit - one of our existing grids has that
3. Performance - some grids have large amount of data to display.
4. Export to Excel and CSV but I can use EPPlus to export the data
5. Sorting
6. Nice to haves : user be able to hide/display columns
7.  jqGrid needs a license but DataTable is free. Ex-developer has coded the jqGrid but looks like he didn't ask our manager to get the license.

From what I read, jqGrid has better performance. I don't know if DataTable has "group by".

What to do? Anyone has used either? My preference is to use DataTable because it doesn't require a license but again...I don't know if it supports "group by". I looked at their site and not clear if they have it or not.

I've found these links with pros and cons:

https://www.slant.co/versus/4837/4840/~jqgrid_vs_datatables

http://debapk.blogspot.com/2012/01/jqgrid-and-datatable-comparision.html
0
Cloud Class® Course: C++ 11 Fundamentals
LVL 12
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

What is the correct way to write a repository pattern.  I wrote the below classes but when I went to use the insert statement I had to pass in T to SQL which I didn't want to do.

I also need to add an additional method "CallSproc" that would pass in the stored procedure name with optional parameters and allow it to be run without returning anything.
public interface ISQL<T>
{
	void InsertStatement(string sqlString);
	void UpdateStatement(string sqlString);
	void DeleteStatement(string sqlString);
	List<T> SelectStatement(string sqlString);
	List<T> SelectSPROC(string sprocName, List<Parameters> parameters);
}

Open in new window

public class SQLData<T> : ISQL<T> where T : new()
{
	string filename = string.Empty;

	SqlConnection SQLConn;
	SqlCommand SQLCmd;
	SqlDataReader SQLRdr;
	string strConnection = string.Empty;

	public void InsertStatement(string sqlString)
	{
		throw new NotImplementedException();
	}

	public void UpdateStatement(string sqlString)
	{
		try
		{
			using (SQLConn = new SqlConnection(ConnectionStrings.GetConnectionString()))
			using (SQLCmd = new SqlCommand())
			{
				SQLCmd.CommandText = sqlString;
				SQLCmd.CommandType = CommandType.Text;
				SQLCmd.Connection = SQLConn;
				SQLCmd.CommandTimeout = 0;
				SQLConn.Open();
				SQLCmd.ExecuteNonQuery();
			}
		}
		catch (Exception ex)
		{
			string x = ex.Message;
		}
		finally
		{
			SQLConn.Close();
		}
	}

	public void DeleteStatement(string sqlString)
	{
		throw new NotImplementedException();
	

Open in new window

0
Please high level what microservices can do?

And from a C# perspective, what is the best way to create them?

.NET CORE?

etc...
0
I used Leaflet.js at my previous job last year. I think in C# code, we created a FeatureCollection (something like that). We also had Geometry column in the database.

1. Now, I have an address and have its longitude and latitude. I get this, for example, from Google API.  I'll save this in the database

2. In Leaflet.JS, I can use GeoJson --> https://leafletjs.com/examples/geojson/

My questions... can I just use the Longitude and Latitude of the address with Leaflet.js?  how does GeoJson come into play ... I don't know why that project had a Geometry column in the database? Why do I need GeoJson? How can I create GeoJson for an address?
0
This is a related question to this question that I asked a while back

Related question


I found a sample code to get the longitude and latitude of addresses. I want to save this data in the database and then use Leaflet.JS to display the addresses on a map.

string address = "123 ABC Court, MyCity, MyState 12345";
			string requestUri = string.Format("http://maps.googleapis.com/maps/api/geocode/xml?address={0}&sensor=false", Uri.EscapeDataString(address));

			WebRequest request = WebRequest.Create(requestUri);
			WebResponse response = request.GetResponse();
			XDocument xdoc = XDocument.Load(response.GetResponseStream());

			XElement result = xdoc.Element("GeocodeResponse").Element("result");
			XElement locationElement = result.Element("geometry").Element("location");
			XElement lat = locationElement.Element("lat");
			XElement lng = locationElement.Element("lng");

Open in new window


That code works but I don't have the GoogleMap API Key in there. I don't need an API Key? how could that code work and get me the latitude and longitude?
0
Hi, I wrote a simple Web API wrapper with Get() and Get(Id) CRUD operations. I need to make sure it is secure.
Can you describe the options from simple to more sophisticated?
Service is deployed on Azure cloud.

Thank you.
0
If I have a .Net executable installed on Server A, but it is being run from server B via a shortcut or otherwise, which server needs the .Net framework installed?
0
I bought this template and was showing the tables section to my manager

https://keenthemes.com/preview/metronic/theme/admin_1/table_datatables_buttons.html

He asked if the datatable...when user clicks on the next page...is going to make an AJAX call and bring back the entire resultset and bind again. He said what if we have 3,000,000 something rows...performance will degrade.

How do these tables work?
0
In my asp.net web application I have multiple config files generated as a part of project template.
when I use command line (visual studio command ) tool to build the project using msbuild command, in my output folder , i don't get the right config file.

say I run this msbuild command ( see below) , at what point the transformation of the config file is supposed to happen. I know the web.debug.config , release.debug.config file hold environment specific values, which are written to the web.config file, depending upon the configuration specified.

I am curious, what actually applies the transformation. and if I were to build this in some build server like jenkins, how would i output the correct config file.

 msbuild  webapplication.csproj  /p:Configuration=Release /p:OutputPath=C:\documents\repos
0
in asp.net C#
I have dropdownlist
in aspx:
</asp:DropDownList>
                                <asp:DropDownList ID="ddl_pol_year"   runat="server" ViewStateMode="Enabled" AutoPostBack="True" EnableViewState="true" OnSelectedIndexChanged="ddl_pol_year_SelectedIndexChanged" >
   </asp:DropDownList>
in .cs file

  protected void f_policy_period(string as_group_no)
        {
          if (as_group_no == "90")
            {
                SqlCommand cmd = new SqlCommand("SELECT distinct Year(R.Renewal_date)  as Renewal_year FROM Reservation R  " +
                                                    "UNION " +
                                                 "SELECT (MAX(Year(R1.Renewal_date)) + 1)  as Renewal_year FROM Reservation R1 " +
                                                 " ORDER BY 1", DbConnString);
           
                try
                {
                    if (DbConnString.State.Equals(ConnectionState.Closed))
                    {
                        DbConnString.Open();
                    }

                    ddl_pol_year.DataSource = cmd.ExecuteReader();
                    ddl_pol_year.DataTextField = "Renewal_year";
                    ddl_pol_year.DataValueField = "Renewal_year";
                    ddl_pol_year.DataBind();
                 
                    if (DbConnString.State.Equals(ConnectionState.Open))
                    {
                        DbConnString.Close();
                    }
 …
0
Cloud Class® Course: CompTIA Cloud+
LVL 12
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

I have a program part of which is used to control one of two interfaces.  When the program starts a determination is made which interface will be controlled. The two interfaces have similar commands (not necessarily identical)  to perform their functions.  I have made a class to handle the actual communication to each interface.  My problem is what would be the best way to select which class gets the commands from the program.  The program is old - written in VB6.  It is a rather large program, and moving it to a different language is not possible.  Although, regardless what language is used, the problem would be the same.

An example:
Interface A is selected
Program issue a command to START_OPERATION.  A black box takes the selection (A) and the command, then creates the command needed by Interface A and pushes it to Interface A
The next time the programs runs, it might select interface B.  The same command (START_OPERATION) is issued.  Now the black box takes the command and modifies it to perform the action on interface B.
There are 20 or so commands which may be sent to either of the interface.  Also each of the interfaces send information back to the program (in different formats) which needs to be "normalized" for the program to use.
I have no control over the interfaces - the commands and formats are not the same.
My initial thought was to use an IF - ELSE on each command inside the black box, but I'm wondering if there might be a better way.
0
I want to create a list and screen scrape data from the list.  The problem I have is that on the below line of code

wb.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(GetScreen);

It does not get invoked until the foreach loop has passed through twice and by that time it only stores the last item in the list.  

How can I loop through all my urls in the list and get the innertext?
public partial class Form1 : Form
{
	public Form1()
	{
		InitializeComponent();
	}

	string url = string.Empty;
	string oldurl = string.Empty;

	private void Form1_Load(object sender, EventArgs e)
	{
		List<string> octopart = new List<string>();
		octopart.Add("https://octopart.com/search?q=JSO-0415-01&start=0");
		octopart.Add("https://octopart.com/search?q=LPAF-40-03.0-S-08-2-K-TR&start=0");

		foreach (var octoparturl in octopart)
		{
			WebBrowser wb = new WebBrowser();
			wb.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(GetScreen);

			url = octoparturl;
			wb.Navigate(octoparturl);
			test(wb, url);
		}

		//wb.Dispose();
	}

	private void GetScreen(object sender, WebBrowserDocumentCompletedEventArgs e)
	{
		if (oldurl == url)
			return;

		oldurl = url;

		var c = ((WebBrowser)sender).Document;
		var d = c.Body;
		var a = d.InnerHtml;
		var b = d.InnerText;
		
		//More Code
	}
}

Open in new window

0
hi there

I am getting this response from IRestResponse object in
 the response.Content I get this string :
{"status":"OK","error":"","pdf_updated":true,"pdf_link":"https://www.xxx.co.il/orders/pdf/777.pdf"}
i need to pull out only the address pdf_link :
https://www.xxx.co.il/orders/pdf/777.pdf
how can i get it  ?
thanks ....
0
Hi, I created a simple ASP.NET Web API and C# console app to test it. It works on local host.
Now I am publishing it to Azure. Replaced localhost with Azure URL and can't make it work.

Any suggestions or resource links?

Thank you in advance.
0
I need a try catch finally on the following code that will close any open connection in case of a fail

    private void brkInsertFail(string Processtype, string FailedID)
    {

        using (SqlConnection objConn2 = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["strConn1"].ToString()))
        {
            using (SqlCommand oCom2 = new SqlCommand())
            {
                oCom2.Connection = objConn2;
                oCom2.CommandText = "EditIndividualClientAPIExternalID";
                oCom2.CommandTimeout = 10000000;
                oCom2.CommandType = CommandType.StoredProcedure;
                objConn2.Open();
                oCom2.ExecuteNonQuery();
            }
        }
    }

Open in new window

0
I am testing an app.  Currently writing a winforms app.  I need to get parts from a website which means I have to screen scrape some data.  The website does display on the WebBrowser control, however, I am trying to get the source so I can build my parts database.  

How can I get the source and parse through it?
            string url = "https://octopart.com/search?q=JSO-0415-01&start=0";
            WebBrowser.Url = new System.Uri(url);

            HtmlDocument document = this.WebBrowser.Document;

Open in new window

0

.NET Programming

133K

Solutions

38K

Contributors

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.