.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

I am receiving the below error.
System.InvalidOperationException was unhandled
  Message="An error occurred creating the form. See Exception.InnerException for details.  The error is: The type initializer for 'MyProject.Singleton' threw an exception."
  Source="Prj - MyProject"
  StackTrace:
       at MyProject.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190
       at MyProject.My.MyProject.MyForms.get_F_Login()
       at MyProject.My.MyApplication.OnCreateMainForm() in C:\Users\xxxxxxxx\Documents\Source_MyProject\Prj-MyProject\Prj\My Project\Application.Designer.vb:line 35
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
       at MyProject.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.TypeInitializationException
       Message="The type initializer for 'MyProject.Singleton' 

Open in new window

0
[eBook] Windows Nano Server
LVL 1
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

I would like to use upwork and outsource one of my mvc project new start. I just need UI designer to use pure html 5 on all cshtml. Do u have some sort of requirement I can use to tell the developer?
0
in bond.bondnamelist - how can i capture the selected state (e.g. CA)
and make bond.bondnamelist like (if CA is selected, the bondnamelist value will be {"CA Product"}? I want to do that on controller codes behind. not razor



public ActionResult BondInfo(Model.Bond bond)
        {
            bond.stateList = new List<string> { "CA", "FL", "TX" };
            bond.bondNameList = new List<string> { "CA Product", "FL Product", "TX Product" };
            return View(bond);
        }

<select class="select2" id="bondState" name="bondState" onchange="fnSaveSingleData(this.name,'1')" data-placeholder="Choose Bond State...">
                                    <option value=""></option>
                                    @foreach (var item in Model.stateList)
                                    {
                                        <option value=@item>@item</option>
                                    } 
                                </select>


<select class="select2" onchange="fnSaveSingleData('bondName','0')" id="bondName" name="bondName" data-placeholder="Choose bond name(s)...">
                                    <option value=""></option>
                                    @foreach (var item in Model.bondNameList)
                                    {
                                        <option value=@item>@item</option>
                                    }                                     
                                </select>



js:

Open in new window

0
Below is MVC project, and how can I pass the state list value into cshtml?


 public ActionResult Index()
        {
            return View(StateList());
        }


 private List<string> StateList()
        {
            List<string> str = new List<string>();
            XElement xelement = XElement.Load(fileBondList);
            foreach (XElement xEle in xelement.Descendants("State"))
            {
                str.Add((string)xEle);
            }
            return str;
        }

Open in new window

0
I'm wanting to show a .gif while some processing goes on in the background, but I'm not able to get it to show, not even sure if it will 'animate', but I'm gonna hope for the best, once I can get it to show.

In my master page I have this:

    <style type="text/css">
        .lnkBtnTFBlue {
            display: none;
        }

        .LockOff {
            display: none;
            visibility: hidden;
        }

        .LockOn {
            font: arial;
            font-size: xx-large;
            font-weight: bolder;
            display: block;
            visibility: visible;
            position: absolute;
            z-index: 50000;
            top: 0px;
            left: 0px;
            width: 105%;
            height: 105%;
            background-color: #CCC;
            text-align: center;
            padding-top: 20%;
            filter: alpha(opacity=75);
            opacity: 1.5;
        }
    </style>

    <script type="text/javascript">
        $(document).ready(function (jQuery) {
            function LockScreen(str) {
                var lock = document.getElementById('LockPane');
                if (lock)
                    lock.className = 'LockOn';

                if (str != '') {
                    lock.innerHTML = str;
                }
            }
        });
</script>
.
.
.
    </form>
    <script type="text/javascript" src="js/jquery-1.11.0.min.js"></script>
    <script type="text/javascript" src="js/response.min.js"></script>
    

Open in new window

0
I am trying to understand this article:

http://www.codemag.com/article/1705021

and how they fulfill the WebAPI mentioned under the heading:

"Create Web API"

I see they stat with an empty C# Controller, but can not find what exactly they mean by WebAPI.

I am not understanding what is meant by the term.

Please explain.

Thanks
0
I am a Senior .NET Full Stack Developer but want to have a sharper eye on the new technologies that are coming and the current technologies which are passing into the dustbin of history. What on-line industry publications are good for this?

Thanks
0
I am refreshing my memory about the various things which can cause a long response time on .NET MVC web pages and the tools to fix them.

A badly written stored procedure is the most obvious and this kind of bug can be uncovered first by looking at the Network tab of the browser and when the response time's too high, you may need to debug into the code to the point where the stored procedure is executed. You can also use SSMS to execute and fix it until the overall execution time becomes acceptable.

What other things can cause slow response and what methods uncover the problem?

Thanks
0
Hi all,

In my visual studio project, I set the target framework to be 4.6.1

But some of my client PCs only have the .net version 4.6.0 installed.

May I know if there is any impact.
I tried executing my application on a PC with version 4.6.0 installed. It seems okay.

Please advise Thanks.
0
I had this question after viewing Corrupt .NET Framework on Server 2012 Standard causing software issues, CBS Log attached, Help!.

Hi, my name is Jose Machado and wotk in IT department of an enterprise.
A few weeks ago, my windows 10 installed updates (I think that was) and when restarted the pc, I tried to open the powershell utility and it fails to start giving an error, but the Powershell ISE opened well.

I lived with the problem a few days more and I make a search and found a webpage that says that the problem is related with one of the windows updates that corrupts the powershell instalation and recommended to uninstall framework and install it again.

I tried to say that but don't find any .net framework under Program and features control panel. I started to uncheck the framework 3.5 and 4.7 under available windows features.
The problem remains and I made another search that guides me to the page  https://blogs.msdn.microsoft.com/astebner/2008/10/13/net-framework-setup-verification-tool-users-guide/  .

I tried to uninistall framework versions but the utility was running about three hours and I cancelled it.
When I restarted the pc the error continues when opening powershell.
I tried one more time without success, but it may advanced a bit because now I open powershell but now when I start the pc, …
0
Free Tool: IP Lookup
LVL 10
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

I have added a ProgressBar and Timer to my project but it's behaving strangely. When I press a button it just increments the progress bar by 1 until it finishes regardless of how long the buttonclick event took. I would like to have it increment and fill to 100 when the event finishes.

Here is my code for the bar under my buttonclick event:

Private Sub FixAllButton_Click(ByVal sender As System.Object, e As EventArgs) Handles FixAllButton.Click
        MasterProgressBar.Value = 0
        MasterTimer.Start()
        FixAllButton.Enabled = False

Open in new window


Here is the rest of the code in the timer sub:

Private Sub MasterTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MasterTimer.Tick
        MasterProgressBar.Value += 1
        If MasterProgressBar.Value = 100 Then
            MasterTimer.Stop()
            FixAllButton.Enabled = True
        End If
    End Sub

Open in new window


How do I make the progress bar dynamically increase depending on the length of time it takes to complete the event and then fill when it ends?
0
while opening team explored in eclipse mars getting below error

Plug-in "com.microsoft.tfs.client.common.ui" was unable to instantiate class "com.microsoft.tfs.client.common.ui.views.TeamExplorerView".


how to resolve this.

Please advise
0
I have complex xml n want to do crud. Any out of box solution?
0
example contrived for the question. Consider following XML sample. I am creating class for serializing and deserializing given sample. I have following classes as well.

In the XML, there could be multiple  Data element, which can either take a base 64 encoded string for its value or
it can take another XML document as its value. so, I created another property data, which is a list of type Data in the Document class.

Question: now my question is, what property should I have in my Data class, because I have to accommodate for both values that this
data element can take.

say for example if i have, in addition to classes below,
public class Data{
   [XmlAttribute]
  public Type { get; set; }  //enum type

  public Class AnotherDocument {get; set;}
}

I can construct the document object, as such, but I don't how to handle the case when type="PDF". Do i add another string property
to Data class? how can i set the value of Data element itself?  

var document = new Document();

document.dataList = new List<Data>{
      new Data {
          type = "XML",
          AnotherDocument = "some xml document"
   }
}

----------------------------------------------------------------

public class Document{
 [XmlElement("Data")]
  public List<Data> dataList { get; set; }
}
---------------------------XML sample ------------------------
<Document>
    <Data Type="PDF">
          base 64 encoded string
    </Data>
    <Data Type="XML">
         …
0
hi,

I am trying below example

http://briansjavablog.blogspot.com/2012/09/spring-jms-tutorial-with-activemq.html

i fired 100 messages as decribed in tutorial and exepcted them to be consumed with message on console.

Intead i am gettign below error


SEVERE: Could not refresh JMS Connection for destination 'jmsReceiveJndi' - retrying using FixedBackOff{interval=5000, currentAttempts=21, maxAttempts=unlimited}. Cause: Cannot send, channel has already failed: tcp://127.0.0.1:8161

under meta-inf context.xml is as below

<?xml version="1.0" encoding="UTF-8"?>
<Context>

   <!--
               Active MQ Connection Factory manages pooled connections
               to the ActiveMQ broker. Tomcat will connect with the
               broker using a TCP connection on port 61616 - this is the
               default port for ActiveMQ
   -->
   <Resource name="jms/mqConnectionFactory"
                     auth="Container"
                     type="org.apache.activemq.ActiveMQConnectionFactory"
                     description="JMS Connection Factory"
               factory="org.apache.activemq.jndi.JNDIReferenceFactory"
               brokerURL="tcp://localhost:8161" />

   <!--
               This is a reference to the first Queue we defined
               earlier in the ActiveMQ admin console
   -->
   <Resource name="jms/testQueueOne"
                     auth="Container"
                     type="org.apache.activemq.command.ActiveMQQueue"
               factory="org.apache.activemq.jndi.JNDIReferenceFactory"
               physicalName="TestQueueOne"/>

   <!--
               This is a reference to …
0
while trying below example

i did all stepas given
http://www.javanbeyond.com/activemq/tomcat-spring-activemq/

when i execute i do not see 3 mesages there

Example Execution:

Start ActiveMQ and login as admin/admin and click on “Queues” tab.
Start Tomcat and deploy the application. You should see three listeners listening to “firstQueue”.

what is difference between
 tcp://127.x.y.z:8161
 tcp://localhost:8161
 http://localhost:8161

which one i have to use.

my active mq running on my own windows laptop locally?
when to use http wen to use ftp?
when to use local host when to use ip like number 127.x.y.z...
please advise
0
Can you please tell me how to i fix that error?
screenshot.pngscreenshot2.pngscreenshot3.pngscreenshot4.png
0
Hello. I have a form.  On that form, I have some radiobutton lists.  On some of those list for example, if you choose no then a text box will display asking why you chose no.  But for some reason when you move to the next question and make another choice and another text box appears the previous one disappears.  I'm assuming it is because I have  autopostback=true on the lists. But if I take that out, nothing happens on the OnSelectedIndexChaged attribute of the list.   Here is the code:

Here is the radiobuttonlist where you can see where I call the function to make the panel visible and the autopostback is set to true. And I also have a validator on it to make the user choose something:
"<asp:RadioButtonList ID="rblConcernsAbtBehavior" runat="server" OnSelectedIndexChanged="rblConcernsAbtBehavior_SelectedIndexChanged" AutoPostBack="true">
                       <asp:ListItem>Yes</asp:ListItem>
                       <asp:ListItem>No</asp:ListItem>
                   </asp:RadioButtonList>
                    <asp:RequiredFieldValidator ID="concernsAbtBehaviorValidator" runat="server"
                                           ErrorMessage="Please choose one" Display="Dynamic"
                                           ControlToValidate="rblSeekingTreatmentAnotherDisability"></asp:RequiredFieldValidator>


Then I create panels for the textboxes that appear based on your choice.  Here is the panel
" <asp:Panel ID="pnlConcernsAbtBehavior" runat="server">
      …
0
I inherited a form that has an html button it
I need to build a on click event (Server side) that redirects to another page

Right now I have a .net label inside the button that works... but it does not make the entire "button" click area.

            <button>
                <asp:Label ID="lblPayNow" CssClass="lblbutton" runat="server" Width="100%" Height="100px"></asp:Label>
            </button>

Server side (.Net)

Page load
Dim path As String = HttpContext.Current.Request.Url.AbsoluteUri
path = path.Replace("TextLanding", "Payment")
lblPayNow.Text = "<a href='" + path + "' style='text-decoration:none;color:#ffffff; width:100%;'>Pay Now</a>"

All of this works...
I just need the "Pay Now" link to fill the button
0
Windows Server 2016: All you need to know
LVL 1
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

hi,

I am looking for good sample example on below area
JMS API Durable subscriber example
can you please point me to some end to end example on this using active mq.

Please advise
0
hi,

can i open two instances of eclipse mars both pointing to same tomcat 8 pointing ?
is that is ok or do i get any error like port conflict or something else?
please advise
0
hi,

within eclipse i have tomcat 8 running. I want to know what location that tomcat running from on my local windows laptop C drive as i happened to have many tomcats in my c drive under different directories
0
I have complex xml that I always need to modify by myself.
Do u know any tools that can make the changes more efficient?
I can just parse to webpage and make change. That may be helpful
0
My old computer was crashed but I have all files save in my usb. I have another computer Dell Latitude D620  with same windows 7. I copied all of my vs 2010 projects and run all of my saved sql scripts back into sql server 2008. But when I try to load projects in visual studio 2010, I am keep getting error.
screenshot.pngscreenshot2.pngscreenshot4.pngscreenshot5.pngscreenshot3.png
0
Hi,

I am compiling a .Net application using Visual Studio 2010 which has 2 C# projects, one VB.Net project and one Deployment project.
It compiled successfully on my development machine on Release/x-86 mode. Compiled successfully (when i compile it manually) on our build server on Release/x-86 mode.
But on same build server when TFS auto build tries to compile it then it is throwing following error:
vbc: compiler initialization failed unexpectedly: Project already has a reference to assembly stdole. A second reference to 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\Visual Studio Tools for Office\PIA\Common\stdole.dll' cannot be added.
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.