Go Premium for a chance to win a PS4. Enter to Win

x

.NET Programming

132K

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

Can I identify whether or not an "exe" is currently running in lotusscript?
0
Nothing ever in the clear!
LVL 1
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

hi - thanks for looking.

would you please help me with the following sql statement using sqlite?

table d
ID int    
trxDate text
(no records in table - the text field is a string of date/time)

table t
ID int    
trxDate text

values for table t:
1, '11/15/2017 13:41'
2, '11/15/2017 13:45'

i need the following:

max of the date/time from table d.  if it is null, return the max date/time from table t.  if that is null, return the current date/time.

i tried to use the IFNULL function, but the second part of the function doesn't seem to be able to have a new SELECT statement within it.

any help would be appreciated.... thank you.
0
Hi,
I can see Password button below, is enabled, but why can't I press it?

http://my-friend.co/UserMaintenance2/Default.aspx?userid=mc23&readonly=n
0
An app was written by another developer.  App contains multiple projects.  One was written in VB and another in C#.  Why?  I don't know.

I created a helper class called "FolderLocation" which is in the VB project.

VbProj -> HelperClass (Folder) - FolderLocation (Class)

I want to reference the Folder in the C# project

C#Proj -> DeliveryEmailer (Folder) -> Sender (Class).

There is a project dependency to the C# Proj in the VB Proj.  I can't add a project dependency to the C# referencing the VB Proj because it will create a circular reference.

Any ideas?
0
Hello I have a series of text boxes to record telephone numbers.  Like this:
Phone Number: (<asp:TextBox ID="txtContHomePh1" runat="server" MaxLength="3" Width="32px"></asp:TextBox>
                       )
                       <asp:TextBox ID="txtContHomePh2" runat="server" MaxLength="3" Width="31px"></asp:TextBox>
                       &nbsp;-
                       <asp:TextBox ID="txtContHomePh3" runat="server" MaxLength="4" Width="49px"></asp:TextBox>

Open in new window

txtContHomePh1 is the area code, txtContHomePh2 is for the next 3 number, and txtContHomePh3 is for the last 4 digits. I want a RequiredFieldValidator to make sure the user fills out the boxes.  Can I use just 1 for all 3 textboxes? Or do I have to put one on each text box?
0
I have some manual code that cleans up a corrupt ini file, for instance removes duplicate sections and keys. I don't like using that custom code, would like to use a standard library instead. Have been looking at https://github.com/rickyah/ini-parser, but it seems to not have any automatic way of cleaning this up. If it encounters an invalid ini file with duplicate sections and keys, it throws an error.

Does anyone here know of a library out there that I can use in .Net C# that automatically fixes the problems described above?
0
I had this question after viewing PDFTK - filling this PDF but got an error.

After talking with the others on this project, we decided it's ok to have the final PDF as read-only and it doesn't need to be editable.

I ran the commands below I can populate the PDF but not the checkbox. Joe (if you're reading this)....is this because of the LiveCycle issue that the checkboxes don't get checked?  If it is, I got approval to buy LiveCycle. I'll get it and see what's going on.

I tried "No" for value, "On", "1" but I don't see the checkbox checked.

1. i-765 is the orig file

2. notsigned.pdf is the file I QPDF-ed to get rid of the password error message

3. Ran this pdftk.exe notsigned.pdf fill_form i-765.txt output OutputFilled.pdf

4. outputfilled.pdf is the populated PDF.
i-765.pdf
notsigned.pdf
OutputFilled.pdf
0
I am getting null values in the PTaxViewModel assessmentSearchParameters in the get method of my PTaxController when I enter a value for each of the inputs in my home page and click the search button.  Any suggestions are appreciated.

Here is my view:
@{
    ViewBag.Title = "Home Page";
    Layout = "_Layout";
}
@model OnlinePayments.ViewModels.PTaxViewModel
@section Scripts {
    <script src="~/lib/angular/angular.min.js"></script>
    <script src="~/lib/angular-route/angular-route.min.js"></script>
    <script src="~/js/app-ptax.js"></script>
    <script src="~/lib/jquery-validation/dist/jquery.validate.min.js"></script>
    <script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"></script>
    <script src="~/js/ptaxController.js"></script>
}
<div>
    <form novalidate name="myForm" id="myForm" data-ng-controller="ptaxController as vm" data-ng-app="app-ptax" ng-submit="vm.getAssessments()">
        <table class="table-full-width">
            <tr>
                <td class="search-cell">
                    <label for="assessmentNumber">Assessment Number: </label>
                    <input type="text"  id="assessmentNumber" name="assessmentNumber" ng-model="vm.assessmentNumber" />
                    <span asp-validation-for="AssessmentNumber"></span>
                </td>
                <td class="search-cell">
                    <label for="ownerFirstName">Owner First Name: </label>
                    <input 

Open in new window

0
With a lot of help, I have written a small c# app that will paste the contents of the clipboard to a specified folder.  Sadly, however, when I put the .exe file onto my RDP - it doesn't work (I'm guessing because it's looking at the RDP clipboard).  Any pointers (or nuget suggestions), would be greatly appreciated - here's the code that I've been working with:

using System;
using System.IO;
using System.Windows.Forms;

namespace TSPaste2
{
    class Program
    {
        //Getting destination foler
        String[] args = Environment.GetCommandLineArgs();

        [STAThread]
        static void Main(string[] args)
        {
            //Setting Destination foler
            string DestFolder = args[0];

            if (Clipboard.ContainsFileDropList())
            {
                //copy to folder as set in the Command line
                foreach (string source in Clipboard.GetFileDropList())
                {
                    string Dest = DestFolder + "\\" + Path.GetFileName(source);
                    File.Copy(source, Dest);
                }
            }
        }
    }
}

Open in new window

0
I'm hoping there's a solution for this problem.

1. I have the FDF that I want to use to populate a PDF. It's attached. It's i-765.txt

2. I have the PDF file. I got it from the INS site. It's attached here and called i-765.pdf

3. I ran this command
   pdftk.exe i-765.pdf fill_form i-765.txt output Output.pdf

but got this error

Error: Failed to open PDF file:
   i-765.pdf
   OWNER PASSWORD REQUIRED, but not given (or incorrect)
Errors encountered.  No output created.
Done.  Input errors, so no output created.


4. I googled the error and came across this solution saying I need to run qpdf Solution to get rid of the error

    a. I downloaded QPDF from here Download QPDF
    b.  It got installed in folder:  C:\Users\bwa\Downloads\qpdf-7.0.0-bin-mingw32\qpdf-7.0.0\bin
    c. I copied i-765.pdf to that folder
    d. Ran this command
qpdf --decrypt i-765.pdf decrypted765.pdf

Open in new window

   e. Now, I have decrypte765.pdf. I open it and get this message. I click ok on it and the PDF is read-only
        Message I get    f.  I ran this command to get rid of the message
pdftk decryptedi765.pdf cat output i-765notsigned.pdf

Open in new window

   g. I open i765notsigned.pdf and there's no error and the fields are editable.
    However,  I noticed this: The functionality of the …
0
NEW Veeam Backup for Microsoft Office 365 1.5
LVL 1
NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

Hello Folks,

I need to build a .NET Application. Initially, it will support to Oracle and later with SQL Server.
So, once migrate with Oracle to SQL Server for data and db schema. It will be done by migration tool.

But, how about CRUD operation, which should common for Oracle and SQL Server?
Should I use plain sql and run time judge with SQL Server & Oracle client OR maintain two entity model?
Do you have any thoughts & suggestions?

Best Regards,
Mohit Sharma
0
If you look at the screenshot below, I've got the code stopped just after the assignment of the List<T> to the DataGridView.DataSource.

The DataSource in the Watch window shows a count of 95 items, and if I expand that list, each item has the correct data.

What am I missing?  : /

datasource
MemParts:

public class MemParts
    {       
        public MemParts() { }

        public void InitMemPartsAsPreview()
        {
            CustID = -1;
            PartNumber = "";
            Description = "";
            TypeID = GlobalDatabaseHelperMethods.GetCellInfo("PartTypes", "PartTypesID", "where Label = 'RAW'", "int").ToString().ExToInt32();
            UMID = GlobalDatabaseHelperMethods.GetCellInfo("UnitMeasureTypes", "UnitMeasureID", "where Label = 'EA'", "int").ToString().ExToInt32();
            ClassID = -1;
            NumberOfLeads = -1;
            CommmonStock = false;
            RoHS = true;
            AllowCrossesID = GlobalDatabaseHelperMethods.GetCellInfo("AllowCrossesTypes", "AllowCrossesID", "where Label = 'APPROVE'", "int").ToString().ExToInt32();
            PackageReqID = -1;
            StatusID = -1;
            Notes = "";
            HasSafetyStock = false;
            ReorderTrigger = 0.00;
            ReorderQnty = 0.00D;
            OtherNotes = "";
        }

        public int CustID = -1;
        public string PartNumber = "";
        public string Description = "";
        public int TypeID = -1;
        public int

Open in new window

0
1. I have this in MVC routeconfig
 public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

           
            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );


        }

Open in new window


2. I have this Controller

  // [HttpPost]
        public ActionResult Index(string formId)
        {

            ViewBag.FormId = formId;
            return View();
        }

Open in new window


3. This works and when I get to the controller, I see "formId"'s value. The URL shows as ?/index/1

  $scope.openForm = function (formId) {

            //console.log(JSON.stringify(formId))

          
            window.location = "/displayform/index/?formId=" + formId; //https://stackoverflow.com/questions/37031143/asp-net-angularjs-how-to-click-on-link-and-route-to-controller-method-with-id

        };

Open in new window


How come these don't work...I step thru it and 'formId" comes out as null. I added HttpPost as well to the MVC Controller. what am I missing?


 window.location = "/displayform/index/"+ formId;

Open in new window



window.open('/displayform/index/' + formId, '_self', false);

Open in new window

0
Hi all,

I get the error in the below code in .NET schema validation. The schema file is shared by some one else using J2EE.  My client is .NET.

"Attribute name="nonEmptyString"  not allowed" => in xs:simpletype


<xs:element name="ID" minOccurs="1" nillable="false">
        <xs:simpleType   name="nonEmptyString">
          <xs:restriction base="xs:string">
            <xs:pattern value="(\s*[^\s]\s*)+"/>
            <xs:maxLength value="15"/>
          </xs:restriction>
        </xs:simpleType>
      </xs:element>

Open in new window

0
I have a side menu and I click on a link. I want to redirect the user to another page and pass a parameter.

1. In Razor, I do this

 <button ng-click="openForm(row.Id)"  class="btn btn-primary btn-border btn-rounded-20 btn-ef btn-ef-4 btn-ef-4b mb-10">{{row.FormName}}<i class="fa fa-arrow-right"></i></button>

Open in new window


2. In AngularJS controller, I have this
 $scope.openForm = function (formId) {

            //console.log(JSON.stringify(formId))

            //$http({
            //        method: 'POST',
            //        url: '/displayform/index',
            //        data: JSON.stringify(formId),
            //        contentType: "application/json",
            //        dataType: "json"

            //}
               
             

            //    ).then(function () { });

          //  window.open('/displayform/index/' + formId, '_self', false);

            window.location = "/displayform/index/?formId=" + formId; 

        };

Open in new window


3. In C# controller
 // [HttpPost]
        public ActionResult Index(string formId)
        {

            ViewBag.FormId = formId;
            return View();
        }

Open in new window


4. The URL looks like this when the user is redirected
http://localhost:63410/displayform/index/?formId=1

Is there a better way of doing this? I wanted the URL to look like this but couldn't get it working...the passed parameter comes out as null http://localhost:63410/displayform/index/1
0
I have a vb.net Windows Forms application compiled in Visual Studio 2013 using .NET 4.0 (not client profile), x86 target cpu.  The application has been running on multiple machines across dozens of networks for several years.  Suddenly a couple of weeks ago it stopped running on 64 bit machines on 1 network. 32 bit machines still run it from the same server. 64 bit machines are running .NET 4.6. Windows updates were rolled back, firewalls turned off, running as administrator, anti virus turned off, user network permissions are good. Any tips would be greatly appreciated.
0
My program do not more importation from exel

how  to restore

Microsoft.jet.OLEDB.4.0

i dont know what happend i suppose there were and update that mess all up
please help !
0
After creating a Windows Form project I added Close(); after InitializeComponent(); in the constructor. When I run the project, i get the following error:

Make sure you have not released a resource before attempting to use it

The error happens in the Program.cs file.

My real code at work is a bit more complicated, what I'm doing is authenticating a user against a table and then trying to close to form if they're not in the table. But the functions I call are called from the constructor, and the error is the same error in the same place. I'd like to know how to close the form from the constructor, other than sinking the error. I'm concerned that there may be a memory leak.
0
Hi Experts,
I am getting an error in LINQ expression that I use in MVC.net with C#.net code behind application.
It's complaining about how I am handling a null date value.
I need help resolving this error

Here is the error:

An exception of type 'System.NotSupportedException' occurred in EntityFramework.SqlServer.dll but was not handled in user code

Additional information: LINQ to Entities does not recognize the method 'System.DateTime Parse(System.String)' method, and this method cannot be translated into a store expression.


Here is my code:
            List<DataObject.HS> _lstTasks = new List<DataObject.HS>();
            using (CDO.CAEntities db = new CDO.CAEntities(new Security().getConnectionString(1), UserID, ID))
            {
                _lstTasks = (from m in db.HS
                             select new DataObject.HS
                             {
                                 ID = (int)m.ID,
                                 IssueDescription = m.IssueDescription,
                                 ResolvedDate = m.ResolveDate == null ? DateTime.Parse("1/1/1900") : (DateTime)m.ResolveDate,
                             }).ToList();
            }
            return _lstTasks;

Open in new window

0
Get your Disaster Recovery as a Service basics
LVL 1
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Hi

I use the following code to display the monday date of the current week

Dim monday As DateTime = Today.AddDays((Today.DayOfWeek - DayOfWeek.Monday) * -1)

Open in new window

I was hoping to amend it so it would display the date of the 2nd monday of the month?

So if I was to run it now it would display 13/11/2017
in december it would display 11/12/2017
in january it would display 08/01/2017

and so on

There is no DayofMonth option whuch i thought would work, any help is appreciated thanks
0
CREATE TABLE Report
(
    YearMonth        INT,
    ReportDateKey    INT,
    Admints          INT,
    AdmisionType     VARCHAR(200)
)
GO

INSERT INTO Report VALUES
(201701,20170131,10,'Acute Care')
 ,(201703,20170330,10,'Acute Care')
  ,(201704,20170430,70,'Acute Care')
,(201706,20170630,10,'Acute Care')
,(201702,20170228,80,'Acute Care')
,(201701,20170228,20,'LTE')
,(201702,20170228,30,'LTE')
,(201701,20170131,50,'RHEAB')
,(201702,20170228,100,'RHEAB')

Open in new window


EXEPECTED OUTPUT:-

AdmisionType	ADK	PreviousMonthADK	YTDADK"
Acute Care	80	10	90
LTE	30	20	50
RHEAB	100	50	150

Open in new window

0
Hello. I have a checkbox list. I want to make it required.  Meaning I want the user to check at least one box in the list.  None of the required field validators work for me.  I also tried doing a javascript validator but I couldn't get that to work.  This is my checboxlist code:

<asp:CheckBoxList ID="cblEduAssistPlans" runat="server" SelectedIndexChanged="cblEduAssistPlans_SelectedIndexChanged" AutoPostBack="true">
                       <asp:ListItem>Individualized education program (IEP)</asp:ListItem>
                       <asp:ListItem>Individualized Family Service Plan (IFSP)</asp:ListItem>
                       <asp:ListItem>504 Plan</asp:ListItem>
                       <asp:ListItem>Other</asp:ListItem>
                   </asp:CheckBoxList>

Open in new window

0
How to generate C# classes from an XSD file?
0
I am trying to deploy an application that is basically a restricted web-browser that I have created within c# using the superb CefSharp libraries.  However, I need to call this application from a command line prompt, adding a switch at the end to take the user to the correct page - for example:

C:\ProgramFiles\TSB\NewBrowswer.exe www.website.com

After using the "Publish" function, and creating the setup.exe file.  I install it, it runs automatically and pops a shortcut into the Start menu.  Whilst this is fine, it won't run correctly unless I issue the website switch at the end (this will ultimately be done through another application).

Ultimately, I need to see a .exe file and control where the Setup.exe file is putting it.

I'm pretty new to c# - so any help would be greatly appreciated.
0
I have one TextBox and one Button. I want to generate number of rows according to number entered in TextBox by clicking the Button in vb.net.
0

.NET Programming

132K

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.