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

I have to do validation for the fees in a textbox. By default, it shows 100000. Basically, the amt in the textbox has to be btwn 100000 - 499999. Problem is now if i want to type 100001, it will change to 100000.. How do i solve this so i can edit the text box with the correct amounts without it constantly correcting my amount?  

Done at <script> part

          if ($(this).val() == "A") {
                      $('#ContentPlaceHolder1_memfee').val(100000);
                       $('#ContentPlaceHolder1_memfee').keyup(function(){
                           if ($(this).val() > 499999) {                           
                               $(this).val('499999');
                           }
                           else if ($(this).val() < 100000) {
                               $(this).val("100000");
                           }
                        });
                  }

Open in new window

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.

Having problem getting my VB.NET web site to use PayPal TLS 1.2.   I am using the PayFloPro API and setting a KEY value to the endpoint URL.  I am running Framework 4.5.1 & working in Visual Studio 2015. This line is in the code: ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12

PayPal lists several endpoints for testing.  "These endpoints allow only TLS 1.2 and HTTP/1.1 connections:" = pilot-payflowpro.paypal.com
When I use this it connects fine.

Then PayPal has another paragraph that says "PayPal has created a new endpoint - https://tlstest.paypal.com - to help you verify that your systems can support the latest security standards".  When I use this it fails with message "RESPMSG = Unexpected transaction state, PayPal_Connection_OK".  Transaction does not go through.

Any idea what is going on here?      Thanks in advance.
0
Hello,I have a project in winforms which takes care of the attendance of the students.In my project I have a form called AttendanceList which has the following:
-a textbox for the Serial number on the NFC tag( the attendance will be based on every student swiping the card over the card reader).
-a combobox where the teacher selects the Course and based on the course,when the teacher clicks a button,the list with all the students should appear.
- a datagridview which displays,updates and deletes the students.
The problem that i'm facing is that when a student registers,he will appear in table RegisterStudent(which is the table for all the registered students).I want to take the values from RegisterStudent(sNr,SN,fName and lName) and insert it in AttendanceList table.This is my method in doing so:
  private void LoadStudents()
        {
            using (SqlConnection conn = new SqlConnection(connstr))
            {
                try
                {
                    using (SqlCommand cmd = new SqlCommand())
                    {
                        string query = "insert into AttendanceList(SN,sNr,fName,lName) select SN, sNr, fName,lName from RegisterStudent p inner join StudentCourses c on p.SN=c.StudentId WHERE  c.CourseId = '" + cmbClassId.SelectedValue.ToString() + "'";
                      // cmd.Parameters.AddWithValue("@CourseId", cmbClassId.Text);
                        cmd.Parameters.AddWithValue("@SN", txtStudentId.Text);
               …
0
Hi,

I've got an SSIS package that looks in a folder for zip files and if it finds them it unzips all of them using C# using a reference to system.io.compression.

This is the example I've used:  example

Here is my code:
using Microsoft.SqlServer.Dts.Runtime;
using System.Runtime.InteropServices;
#region Namespaces
using System;
using System.Data;
using System.Windows.Forms;
#endregion
using System.IO.Compression;
using System.IO;
[assembly: ComVisible(false)]
namespace ST_51121ce851f54f58bb7a111e9711bfb7
{
  
    [Microsoft.SqlServer.Dts.Tasks.ScriptTask.SSISScriptTaskEntryPointAttribute]

    public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
	{
     
		public void Main()
		{
          
            string zipfullpath = Dts.Variables["User::ZipFullPath"].Value.ToString();
            string inputfolder = Dts.Variables["$Package::InputFolder"].Value.ToString();

            using (ZipArchive arch = ZipFile.OpenRead(zipfullpath))
            { foreach(ZipArchiveEntry entry in arch.Entries)
                {

                    try
                    {
                        entry.ExtractToFile(Path.Combine(inputfolder, entry.FullName));
                    }
                    catch (Exception ex)
                    {
                        //local variable to update error description
                        

Open in new window

0
ASP.NET C#
Visual Studio 2017

Description:
example of form
I am creating a form where the user clicks an image (image has runat='server' attribute), and then uploads a new image that replaces the old image.
( Note: that when the user uploads a new image it is renamed to exactly the same name as the old image. )

I'm using a hidden Fileupload control for uploading images.

Problem:
Initially ( when I upload the first version of the image ) everything works fine, but once I start uploading new images ( to replace the old ones ) I start getting the error:

System.IO.IOException: The process cannot access the file 'filename' because it is being used by another process.

Code Sample:
I do some validation checks and then something like:

try
{
    fileUpload.PostedFile.SaveAs(path);
}
catch (Exception ex)
{
     lblMessage.InnerText = ex.ToString();
}
finally
{
    fileUpload.Dispose();
}

Open in new window



I tried adding this to see if it works but I still have the same issue:
private void SaveFile(FileUpload fileupload, string path)
        {
            fileupload.PostedFile.SaveAs(path);
            const int numberOfRetries = 10;
            const int delayOnRetry = 1000;

            for (int i = 1; i <= numberOfRetries; ++i)
            {
                try
                {
                    fileupload.PostedFile.SaveAs(path);
                    break; 
                }
                catch (IOException e) when (i <= numberOfRetries)
                {
                    Thread.Sleep(delayOnRetry);
                }
            }
        }

Open in new window


I've also tried toggling images to see if that helps.  For example: If the current image is xxxxa.jpg then save as xxxxb.jpg.  But I still get the same error message.

Final Notes:
I am able to upload images but it seems to be random, sometimes it works and sometimes ( often ) I get the error message.  I've tested the same code on my desktop and everything works great but when I put it on the live server I start seeing the error message.
0
I decommissioned a database analysis server and need to move a tabular  model to a new server. I open the project in Visual Studio, change the workspace server yet when I try to compile I get "cannot build projects that contain more than one .bim file". There is only one .bim file in this project. Where is 2nd one?
0
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
I am using crystal reports version 13 and Visual Studio 2010. I have exported read only report version of all my crystal report i.e. rptr extension.

Now I am loading report (rptr) in asp.net page and exporting it to pdf. But it says 'unable to load report'
Please help me out.

Regards
0
Hi,
I am using VISUAL SOUCE SAFE 2005.
I got the error while creating the projects.
I send the screenshot of the my desktop.
Please find the solution.
Thanking you sir.
0
Hello,

Changing Target CPU from X86 to x64 makes the designer have lot of errors. I am using visual studio 2017.
any suggestions?
0
Network Scalability - Handle Complex Environments
Network Scalability - Handle Complex Environments

Monitor your entire network from a single platform. Free 30 Day Trial Now!

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
I using SVN 1.9 and in the last week start appearing the "Auth" folder and "config" files in every folder in my PC, the only program installed was Visual studio, this behavior take much file space and add trash to my folders. i attach a image

how can i fix this?
0
I am integrating into a webservice, it returns json, here are 2 types of results from it
{"numFound":1,"QTime":77,"attributions":"http://www.gisgraphy.com/attributions.html","result":[{"id":100004730,"lng":36.710459425750635,"lat":-1.336961662155654,"streetName":"Marula Lane","city":"Bulbul","state":"Kajiado","countryCode":"KE","geocodingLevel":"STREET","distance":300.4280656229352,"adm1Name":"Kajiado","formatedFull":"Marula Lane, Bulbul, Kajiado, Kenya","formatedPostal":"Marula Lane, Bulbul","speedMode":"OSM","maxSpeed":"30 mph","azimuthStart":267,"azimuthEnd":251,"length":1161.411457366,"sourceId":33136013}]}



{"numFound":1,"QTime":2537,"attributions":"http://www.gisgraphy.com/attributions.html","result":[{"id":22523950,"lng":36.81669998168945,"lat":-1.2833000421524048,"zipCode":"09831","city":"APO AE","countryCode":"US","geocodingLevel":"CITY","distance":13413.984061400277,"formatedFull":"APO AE,  (09831), United States","formatedPostal":"APO AE, 09831"}]}

Open in new window


I've used the visual studio paste special as JSON class on the first result as that seems to have more info
I'm using the 2nd result as the  test scenario

I then use this code
Result json1 = JsonConvert.DeserializeObject<Result>(jResult);

Open in new window


But all the objects are empty or null

What am I doing wrong?
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 have a stored procedure in Oracle that I wish to use for a query in Crystal Reports for visual Studio.

The procedure is as follows - that works fine for dates.  

Dow, If I wanted to create a parameter for, say, StyleNo, however the styleNo could have multiple paramaters OR be null, i.e. Parameter optional in Crystal, how could I go about doing that?

Thanks a million

create or replace procedure pr_TopMerchSales(DateFrom IN Date, DateTo IN Date, prc out sys_refcursor)
is
begin
  open prc for
  select  Dept
      , DIV
      , StyleDesc
      , StyleNo
      , vendor
      , Round((select sum(V.qty) from V_TOP_MERCH_SALES V where V.vendor = I.vendor and I.Dept = V.DEPT and I.DIV = V.DIV and I.StyleNo = V.StyleNo and V.CREATED_DATE >= trunc(DateFrom) and V.CREATED_DATE <= trunc(DateTo)),2) as QtySold
     
from CMS.INVENTORY_V I
where I.ACTIVE = 1
group by DIV , Dept, StyleDesc,StyleNo, I.Vendor

end;
0
I have a C# project written in Visual Studio 2017.

After creating the project and testing it, I created a installer package using Advanced Installer Software. The package found all the dependencies ok and the installer works fine when I test on my local machine. However, I am concerned whether I should be adding prerequisites and how to determine Which ones I need.
In particular I am not sure about Windows Framework (the installer lets X86 and X64 be selected, my project was compiled for "Any CPU)
Another one is the DotNet Framework. Shoudl I just select the same one I used when compiling my VS project?
Finally, the C++ re-distributable. I have seen programs not install in the past when this is not installed but I am not sure whether I really need to add as pre-requisite and how I determine which version is needed for my application?

Thanks
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
Experts,

I have an asp.net application that has a reportviewer embedded in an aspx page. When I run it locally through visual studio it works fine. When I deploy the application to my app server and run it, the reportviewer gives me the following error:

The permissions granted to user 'domain\appservername$' are insufficient for performing this operation. (rsAccessDenied)

The report viewer isn't picking up my credentials and instead is getting those of the app server. I'm using windows authentication on my site.

Anyone help getting to the bottom of this will be much appreciated.

Regards,
0
Protect Your Employees from Wi-Fi Threats
LVL 1
Protect Your Employees from Wi-Fi Threats

As Wi-Fi growth and popularity continues to climb, not everyone understands the risks that come with connecting to public Wi-Fi or even offering Wi-Fi to employees, visitors and guests. Download the resource kit to make sure your safe wherever business takes you!

I'm in the process of creating a Web page which links to our company database and display data into 2 GridViews. I intend for both of them to be displayed side by side.

I'm using Microsoft Visual Web Developer 2010 Express for this project.

Therefore, I added a table and separated it into 3 columns:

<asp:Table ID="Table3" runat="server" Width = "100%" Font-Bold="True" 
                Font-Names="Arial" Font-Size="Large" BackColor="#B9FFFF" CellPadding="0" 
                CellSpacing="0" Height="18px">

                <asp:TableRow>
                    <asp:TableCell Width = "45%"> Status Time Collector</asp:TableCell>
                    <asp:TableCell Width = "10%"> &nbsp </asp:TableCell>
                    <asp:TableCell Width = "45%"> Actual Quantity Data Collector</asp:TableCell>
                </asp:TableRow>

Open in new window


The result is as follows, (the blue row is the table):
vb-table.JPG
I then try to insert the GridView into the table by dragging GridView into the design and move it within my <asp.table> code:

<asp:Table ID="Table3" runat="server" Width = "100%" Font-Bold="True" 
                Font-Names="Arial" Font-Size="Large" BackColor="#B9FFFF" CellPadding="0" 
                CellSpacing="0" Height="18px">

                <asp:TableRow>
                    <asp:TableCell Width = "45%"> Status Time Collector</asp:TableCell>
                    <asp:TableCell Width = "10%"> &nbsp </asp:TableCell>
                    

Open in new window

0
Hello experts,
I have created a very small program in visual basic 2017 less than a hundred lines...
its works fine but when reaching the line END the program shows the following error message

System.Runtime.InteropServices.COMException: 'Exception from HRESULT: 0x800AC472'

have tried it all... how can I solve this issue?
Regards,

Here is the program:

Imports Microsoft.Office.Core
Imports Microsoft.VisualBasic
Imports Excel = Microsoft.Office.Interop.Excel


Public Class Form1
    Dim ss_tmp_fdr As String

    Dim dt As Date, dts As String, W_PATH As String, W_FILENAME As String

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim fn As String, ss_tmp_fdr As String
        Dim xlSheet As excel.Worksheet
        'My.Computer.FileSystem
        'My.Computer.FileSystem.
        dt = Date.Now
        dts = Mid(Str(10000 + dt.Year), 3, 4) & "-" & Mid(Str(100 + dt.Month), 3, 2) & "-" & Mid(Str(100 + dt.Day), 3, 2) & "_" & _
             Mid(Str(100 + dt.Hour), 3, 2) & "-" & Mid(Str(100 + dt.Minute), 3, 2) & "-" & Mid(Str(100 + dt.Second), 3, 2)

        ss_tmp_fdr = f_ss_tmp_fdr()
        read_open_xls(ss_tmp_fdr)
        fn = W_PATH & W_FILENAME
        Dim XL As excel.Application
        XL = New excel.Application                                         'Set to new instance of excel
        XL.Visible = True
        XL.WindowState = excel.XlWindowState.xlMaximized
        …
0
Hi Experts,

I've been running VB6 / Visual Studio 6.0 Pro Service Pack 6 on my Windows 10 PC for a year or two.

I also have Visual Studio 2013 Pro installed.

But recently any attempt to open the VB6 IDE is greeted with a number of dialogs (1 minute screencast).

The first dialog comes up a few times:

Please wait while Windows configures Microsoft Visual Studio Professional 2013...
Gathering required information...

The Visual Studio Professional 2013 dialogs run to completion, then this dialog opens up:

Windows Installer
Preparing to install...

That dialog never shows any further information and does not finish.

I'm locked in an endless loop.
If I terminate the running task and start again, I can never open a project.

Regards,
Leigh
0
Hi,
Any suggestions for Xamarin course.

Thanks
0
I followed a tutorial to add multiple app config files, for different environments,  to a console application project.  This is how it is structured in the visual studio (see below at the end)
Basically, idea is to use transformation to replace the values in the config file based on the environment.

one issue, I'm running into is now when I try to remove the UAT and Live config files and try to build the project. it complains those files are missing.
I know these files are not needed to build the solution and I cannot find anywhere where these files are referenced in the project.
why is visual studio complaining about these files missing, when it doesn't need these files in the first place? also i get same error from the command line, when i use msbuild.


App.config
  App.UAT.config
  App.Live.config
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

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.