Microsoft Visual Studio

644

Solutions

697

Contributors

Microsoft Visual Studio is an integrated development environment (IDE) from Microsoft. It is used to develop computer programs for Microsoft Windows, as well as web sites, web applications and web services. Visual Studio uses Microsoft software development platforms such as Windows API, Windows Forms, Windows Presentation Foundation, Windows Store and Microsoft Silverlight. It can produce both native code and managed code.

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

Sign up to Post

There is a drop down list and a text box. Basically the ddl has 5 options and tb will show the date for the first 2 options and then if next 3 options is selected, tb shows 'NA'.

Problem: By default it will show the date in tb. If i select the THIRD option and then back to the FIRST option, it still shows 'NA'. How do i get the ddl to show back to the date after filtering options 3/4/5.

Script code
  <script>
          $(document).ready(function () {
              $('#ContentPlaceHolder1_Choose).change(function () {
                  // Filter ddl w/ date
                  if ($(this).val() == "Friend of IPS") {
                   $('#ContentPlaceHolder1_datetime').prop( "disabled", false);
                  } else if ($(this).val() == "") {
                      $('#ContentPlaceHolder1_datetime').prop("disabled", false);
                  }
                  else {       
                      $('#ContentPlaceHolder1_datetime').prop("disabled", true);
                      $('#ContentPlaceHolder1_datetime').val("NA");
                  }
              }); 

        });
        
    </script>

Open in new window

Html code
    <div class="form-group">
    <label for="lblChoose"> Choose:</label>
    <select runat="server" class="form-control" id='Choose' style="width:350px; left: -1px; top: -2px;">
      <option value="">Select</option>
      <option value="A">A</option>
      <option value="B">B</option>
      <option value="C">C</option>
      <option value="D">D </option>
    </select></div>

  <div class="form-group">
    <label for="lblExpiryDate">New Expiry Date:</label>
      <input runat="server" type="text" class="form-control" style="width:350px;" id="datetime" />
  </div>

Open in new window


cs code
(How i got the date to show by default basically)
 datetime.Value = DateTime.Now.AddYears(1).ToShortDateString();
0
Simplify Active Directory Administration
LVL 8
Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

Hello,

Changing Target CPU from X86 to x64 makes the designer have lot of errors. I am using visual studio 2017.
any suggestions?
0
a c# solution has multiple projects with a .nuget project/folder as well. Inside it is the executable NuGet.exe.
what is the purpose of this executable and I see this executable is checked into the source code repository too.

does this executable , download the latest packages or packages needed for the project, like we run a command "nuget get package " in visual studio.
why do we need the executable though , for this?
0
How do I access Visual Basic from within Visual Studio 2017?
0
Is the latest version of Visual Basic part of Visual Studio 2017?  I really only need the latest version of Visual Basic for Winows 10.  That's all I really need.
0
I need some advice on learning a new programming language.    I have background in computer graphics so I am a visual type of person.  I want to create a program that will help my wife back up her files to the external hard disks and learn how to code other programs.  Soon I am going to go over some online videos about programming terminology so I can learn different terms and what they mean.

Next:
I have written some short scripts in PowerShell and I like it a lot because it is very fast, but I also recently downloaded Visual Studio 2017 and am thinking about using Visual Basic instead because I think it would be easier for me to learn.

How fast is Visual Basic compared to PowerShell and what do you think I should use?
0
Hi,
Any suggestions for Xamarin course.

Thanks
0
Create assembly [SMS_Attend]
from 'C:\Users\Muhammad\Documents\Visual Studio 2015\Projects\Database3\Database3\bin\Debug\Database3.dll'
with permission_set = unsafe

Open in new window


CREATE ASSEMBLY failed because it could not open the physical file 'C:\Users\Muhammad\Documents\Visual Studio 2015\Projects\Database3\Database3\bin\Debug\Database3.dll': 5(Access is denied.).

0
How do u bundle files in visual basic.net. What I mean is I have three files that need to goto programdata\reprint    how do I force the program to put those files  in dir path? Do I have to use file.write in the form load or is there a better way to package it. Maybe a package maker of some sort?
0
Hi, I installed Visual Studio 2017, SQL Server Management Studio and SQL Server Data Tools. Later I also run SQL Server Installation 17 with default values.
Now I have 2 SQL Server Instances running: (localdb)\MSSQLLocalDB and (localdb)\ProjectsV13.
Why?
Why  .  and local logins don't work with Windows Authentication?

Thanks.
0
On-Demand: Securing Your Wi-Fi for Summer Travel
LVL 1
On-Demand: Securing Your Wi-Fi for Summer Travel

Traveling this summer?Check out our on-demand webinar to learn about the importance of Wi-Fi security and 3 easy measures you can start taking immediately to protect your private data while using public Wi-Fi. Follow us today to learn more!

Hi

Experts!

For those that have dealt with Management studio in SQL or Visual studio with C#, how do we deal with the following?
(1)      Capturing data or inserting data into a parent and child tables in Ms Sql Server. For example a sales invoice will have parent table which hold the invoice number and customer details, while the child will have the actual lines or details of the products purchased.
(2)      I have seen one control in C# windows form for application, it is called datagrid , but I cannot figure it out properly how I can use it to create the lines/datasheet  in the child form
(3)      If I link the child forms like below can it work?

private void invoiceDetailLineToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form2 frm2 = new Form2();
            frm2.Show();
            frm2.MdiParent = this;
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            IsMdiContainer = true;
        }
        private void salesAccountingToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form3 frm3 = new Form3();
            frm3.Show();
            frm3.MdiParent = this;
        }
I’m told clearly that in Ms Sql server there no forms to bind like we do in Ms access, this means that we have to use window forms and do the coding in C# and Sql scripts
0
I am a newbie programmer with only 2 years of experience (this is the time I'm getting paid for coding) and just started to bump into problems that comes with legacy code. Being dropped into different projects, having a fairly large codebase (10.000 lines and up), I often find myself having difficulties understanding and contributing to them.

I'm aware most of the coding skills come with the years one spends with practicing, still, I was wondering if there are any tools (even 3rd party) out there that you would recommend to use. I'm thinking about apps/plugins that helps to visualize or map the connection between classes, interfaces, etc. I'm working with Visual Studio and I'm aware it has built-in capabilities to reverse code into diagrams but thought I would ask around for other possibilities, too.

Thank you for your recommendations.
0
I'm trying to deploy a report from Visual Studio 2010 to a specific folder on my clients report server.  When I right click on the report and click Deploy, it gives me:
deply notesand this indicates that the report is going to the /Maestro/Adoption Reports/ folder.  But I don't see this folder listed anywhere in the properties of the report, or anywhere else.  How do I go about changing the folder the report gets deployed to?
0
Is there a way to use Visual Studio in Mac and connect to an Azure Database?
And if I am able to do that can I still compile the project and use it in a windows server ?
0
Dear experts,
I create web sites with html5 and I use php 7.
I learned PHP. I'm good at it.

however I'd like to learn asp.net to create web sites.
Becuase my company, like most of the companies use Windows platforms.
this time the web site that I'm going to create will be hosted on our machines on windows hosting envirement

I installed Visual studio and I don't know where to start.

what do you suggest I should do?
which tutorials do you suggest?
0
Dear Experts!


Sorry to bother you again,

I'm trying to understand the Visual Studio very well, I have no much difficulties on code, but form organization and linkage is still a challenge.

I have created a MDI form as per code below, I have no issues on controls, a few issues on the following:

(1) How to create a datasheet form in windows form application for an invoice table found in my access database. Once I happy with the interface we will be using MS access as a Back End while the front end will be in C#
(2) The parent table has the following controls:

- tblinvoice
- ID
-InvoiceID
-CustomerID
-Date
-Salesman
-Branch
(3) Child 1 has the following:

-tbllinedetails
-ProductID
-Product Description
-QtySold
-Price
-Discounts
-VAT
-LineTotal

(4) Child 2 has the following
- tblsalesJournal
- date
- Dr
- Cr

(6) All the two child tables have datasheets, now how do I create the same datasheets in C# windows form application (input forms) so that people can capture data normally like they do in Ms Access

(7) Any sql to insert data using MS Access 2016?
(8) I understand we are required to drop the database in Visual Studio directory and link it from there, how is it done.

If the above issues can be sorted out then i'm almost done with C#.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
0
Hi Experts

Could you confirm if the overall Visual Studio 2008 OLAP project concepts  (BIDS) are still useful nowadays?

I'm following a video course I obtained using this OLAP version.

I couldn't find any more apropriated topis for this question.

Thanks in advance
0
background: had vs2010, 2013, and 2017 community.   Just uninstalled 2010 and 2013 because of issues.  

I have a project with a component that we wrote, in vs2010 & .net 4.0.  I've created a new solution, imported the old projects within the solution.   It now have .net 4.7.1 since 4.0 is not available in the list anymore (and not downloadable apparently).   This component was using the Extensibility Tool (which i've installed on vs2017).

But i still have some errors, all related to this component:

CS0616	ProvideToolboxControlAttribute' is not an attribute class
CS0641	Attribute 'AttributeUsage' is only valid on classes derived from System.Attribute

Open in new window


Note: within this file, beside System and System.Globalization, all the other "Using" are greyed out, like if they where not used.  

Anyone can help?  These classes are deprecated? (AttributeUsage?)  How can i solve this issue?

Thanks
ProvideToolboxControlAttribute.cs
0
I need to modify a C# console application to output a SQL result set to a CSV file. Currently the application sends the output to a Text box (textXMLResult).

Current Visual Studio Solution:
XXXApiSample
-Service References
-Properties
-References
-app.config
-C# ExampleCode.cs
-FormApi.cs
-C# Program.cs
-C# UseCase.cs
-C# Utility.cs


C# Program.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace XXXApiSample
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new FormAPI());
        }
    }
}

Open in new window



FormApi.cs
...
        private void buttonGetData_Click(object sender, EventArgs e)
        {
            this.textXMLResult.Text = "";
            ExampleCode ec = new ExampleCode();
            this.textXMLResult.Text = ec.GetData(this.textServiceUrl.Text,
                this.textUserName.Text,
                this.textPassword.Text,
                this.textScreenName.Text,
                this.textGetDataParams.Text);

        }
...

Open in new window



What I want to do is send the output of the query to a CSV file prior to the Textbox (textXMLResult).  In part because the textbox has a MaxLength of 32767 and also to do additional work on the file result set.
0
Making Bulk Changes to Active Directory
LVL 8
Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

On a build of my solution I am getting the message below
It shows as succeeded but what does the message mean?

Error occurred while restoring NuGet packages: System.ArgumentException: The path is not of a legal form.
   at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
   at System.IO.Path.GetDirectoryName(String path)
   at NuGet.VisualStudio.VsUtility.GetNuGetSolutionFolder(Solution solution)
   at NuGet.VsEvents.PackageRestorer.UsingOldPackageRestore(Solution solution)
   at NuGet.VsEvents.PackageRestorer.BuildEvents_OnBuildBegin(vsBuildScope Scope, vsBuildAction Action).
------ Build started: Project: wsClientAPI-Prod, Configuration: Debug Any CPU ------
Warning: Unable to update auto-refresh reference 'restsharp.dll'. Cannot find assembly 'C:\Webs\wsClientAPI-LarryT\packages\RestSharp.105.2.3\lib\net4\RestSharp.dll'.
Warning: Unable to update auto-refresh reference 'stripe.net.dll'. Cannot find assembly 'C:\Webs\wsClientAPI-Prod\packages\Stripe.net.4.2.1\lib\net40\Stripe.net.dll'.
Validating Web Site
Building directory '/'.

Validation Complete
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========

Open in new window

0
We recently migrated from VS2008 to VS2015.
How would you recode the attached small script from a VS2008 SSIS Script Task so it would run under VS2015.
VS2008ScriptMain.vb
ScriptInfo.xlsx
0
Hi,
I am trying to call the method


 AddHandler menuItem4.Click, AddressOf CopyEditVehMain_Click(dgv)
I get an error : addressof operand must be the name of a method+vb.net


Thanks
0
Unable to change sharepoint 2016 .cs file with Visual Studio 2017 Pro.  (Version 15.7.1)
Error: "Update required" Wants to install Office Developer Tools for SP2015.
When I try and install it: Says I need to install VS 2017 Community edition.

Here's what's installed now.
Capture.PNG
Any ideas?

JS
0
Tried a lot to identify the root cause of this error but totally failed. Any suggestion will be highly helpful.

Try
    Dim Smtp_Server As New SmtpClient
    Dim e_mail As New MailMessage()
    Smtp_Server.UseDefaultCredentials = False
    Smtp_Server.Credentials = New Net.NetworkCredential(txtFrom.Text, txtPassword.Text)
    Smtp_Server.Port = cmbPort.Text

    Smtp_Server.EnableSsl = cbxSSL.Checked
    Smtp_Server.Host = cmbHost.Text

    e_mail = New MailMessage()
    e_mail.From = New MailAddress(txtFrom.Text)
    e_mail.To.Add(txtTo.Text)
    e_mail.Subject = "Auto Email"
    e_mail.IsBodyHtml = False
    e_mail.Body = "Hi, This is test mail."

    Smtp_Server.Send(e_mail)
    MsgBox("Mail Sent")


Catch error_t As Exception
    MsgBox(error_t.ToString)
End Try

Open in new window

0
Hi, if anyone helps me to write the better way to write this code, more appreciate. because inside code lot of If conditions,May be using sql
  private void cmbRequisitionNumnber_SelectedIndexChanged(object sender, EventArgs e)
        {
decimal ReqCost = req.RequisitionCost(cmbRequisitionNumber.Text.ToString());
            lblcost.Text = ReqCost.ToString();

          

            if (ReqCost >= 1000 && ReqCost< 5000)
            {
                cmbApprover2.Enabled = true;
              

            }

            if (ReqCost >= 5000 && ReqCost < 10000)
            {
                cmbApprover2.Enabled = true;
                cmbApprover3.Enabled = true;
              

            }

            if (ReqCost >= 10000 && ReqCost < 20000)
            {
                cmbApprover2.Enabled = true;
                cmbApprover3.Enabled = true;
                cmbApprover4.Enabled = true;
               

            }

            if (ReqCost >= 20000 && ReqCost < 80000)
            {
                cmbApprover2.Enabled = true;
                cmbApprover3.Enabled = true;
                cmbApprover4.Enabled = true;
                cmbApprover5.Enabled = true;
           

            }

            if (ReqCost >= 80000 )
            {
                cmbApprover2.Enabled = true;
                cmbApprover3.Enabled = true;
                cmbApprover4.Enabled = true;
                cmbApprover5.Enabled = true;
                cmbApprover6.Enabled = true;

       

Open in new window

0

Microsoft Visual Studio

644

Solutions

697

Contributors

Microsoft Visual Studio is an integrated development environment (IDE) from Microsoft. It is used to develop computer programs for Microsoft Windows, as well as web sites, web applications and web services. Visual Studio uses Microsoft software development platforms such as Windows API, Windows Forms, Windows Presentation Foundation, Windows Store and Microsoft Silverlight. It can produce both native code and managed code.