[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x

Microsoft Visual Studio

743

Solutions

790

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 am teaching myself visual basic using visual studio. Please help a newbie.

I have created a form with a data-grid bond to a data-set. It populates perfectly. (I am not using all the fields in the table though, just the ones that might need to be edited)

I just realized that what I update on the data-grid does not update the sql table.

Is there a way that when a data is changed in any cell, a row is removed, or rows added, that it will update the sql table on the fly. Maybe through an event.

If so how??  I have been combing through google videos and haven't found a thing that doesn't use a button to accomplish what I want.
Please give me step by step. If I can fire an event with code which do I use?
0
Powerful Yet Easy-to-Use Network Monitoring
Powerful Yet Easy-to-Use Network Monitoring

Identify excessive bandwidth utilization or unexpected application traffic with SolarWinds Bandwidth Analyzer Pack.

Visual Studio 2015, SSDT, Report Authoring, Windows 10

I am having a very difficult time getting my VS2015 installation to include SSDT and Reporting Authoring Extension (for Fetxchxml).  I have tried suggestions from the web, Stack Overflow and downloaded several versions of SSDT and Report Authoring Extensions.  I have uninstalled versions that didnt work, rebooted and tried again.

I am thinking that if I can get the versions from someone where all three components are working on Windows, I should be able to get this working.  I have had this working on other laptops, older versions of VS and other operating systems.

My environment is:
Dell Latitude i7 | 64-bit processor | x64 processor
Windows 10  | Version 1803  |Build 17134.167
Visual Studio Professional 2015  | Version 14.0.25431.01 Update 3

As for SSDT, not having a lot of problems installing this; it is where I try to install the Report Authoring Extensions that I encounter problems.  I am able to get the RAE wizard to run (to failure) using the advice from this link: http://meganvwalker.com/creating-fetch-xml-reports-using-visual-studio/

When the RAE install fails it tells me that SSDT is not installed; I have tried many versions of SSDT, SSDT-BI, BIDS and Report Authoring starting with the VS2015 versions (and earlier versions).

I am just spinning my wheels.

Thank you.
0
I am using visual studio 2010 for a  web application with gridview populated by dataview source of which is a datatable.
One of the fields diffimt is numeric field defined as follows:
 DataColumn diffimt = new DataColumn("diffimt", typeof(int));
I wanted the dataview and hence the gridview to be sorted in the ascending order of the field
dView.Sort = "diffimt ASC";
After the sort command, gridview is source to dataview and then databound with the following commands
dView.Sort = "diffimt ASC";

                GridViewVa.DataSource = dView;
               GridViewVa.DataBind();

But it is sorting as if it is a text field.  Screeshot is depicted in the attached file.  As for my requirement, the sorting should be
12,13,102,102,107…….. Not 102,102, 107 …
Can anyone help in fixing the problem
20181020_GridView_Screenshot.jpg
0
I have googled this one and despite numerous suggestions I have not succeeded and yet it seems so simple.
In visual studio community 2017 edition, I have a vb web application which includes an XML file of program settings which I do not want to embed, I want it to stay as an .xml file so the site's behavior can be altered without recompilation.
When I run the web application in debug , the output folder shows the web app DLL of the compiled web app and no XML file and the program fails to locate it.
The file is set to Copy to Output directory and I have tried Content, Additional Files, None, to no avail, it never copies.  If I copy the XML file to the output folder whilst in debug mode it works so the question is why does my XML file not copy to the output directory.
I have included the xml file at the top level of the project.  
What needs to happen for the web app to copy the XML file to the temporary debug iis express folder so my website can find it and work?
Thank you,
0
Hi Folks,

I'm starting to get myself in C#, I am as far as writing my own basic "hello world" sample ;) -see below
IDE: Visual Studio Community 2017
PCs: Laptop, Desktop
Problem: when I write and test the code on computera everything works as it should, but when i copy the same folder files incl. the my test.cs onto another PC the debugging feature becomes disabled(-see figa) and if i try to run it from the play button it brings me to a "attach process"... (-see figb)
Background experience: Powershell, Bash, Batch.
Odd solution?: copy/paste the content of the file onto a new one and then save it then run it..., is this normal, or am i doing something wrong?  

By the way does anybody have a link to a cheatsheet for c# with basic commands?

{
    class Program
    {
        static void Main(string[] args)
        {
            //The Code always starts Here
            //This example is to various methods to write txt
            Console.WriteLine("Hello I'm at your service. \n2ND Line This is a new line");
            Console.Write("Press Any Key to Continue"); 
            Console.ReadKey();
            Console.WriteLine("");
            Console.WriteLine("");

            //This example involves variables TXT , (this involves declaring variables first)
            string greeting, who;
            greeting = "Salut, ";
            who = "Mon Ami";
            Console.WriteLine(greeting + who + "!");
            Console.WriteLine("Press Any 

Open in new window

0
SQL 2012 - Visual Studio 2012

I have created a report in Visual Studio that has one field that is a Decimal (19,9) that I have it displaying as a blank if the number is zero.  There are a lot of zeros in this column.  I need to count the number of zeros.  How can I achieve this?
Unallocated-Summary.rdl
0
I have an SSRS data set which returns columns: ClientName, Date, Description, and Miles based on a number of parameters.  I have assigned this dataset as the source for a tablix in my report but cannot figure out how to configure the tablix to get the output to look similar to:

grouping
0
Using Visual Studio Community 2015.  Just curious about something.

While debugging, stopped on a breakpoint, in my Immediate Window, I tried this and got the response as follows:

new Date()
Wed Oct 17 2018 09:18:28 GMT-0600 (Mountain Daylight Time)
    __proto__: Invalid Date

So... it gave the right date / time stamp ... then essentially said "date is not valid" ???


Just for grins, I did some other experimentation:
new Date()
Wed Oct 17 2018 09:18:28 GMT-0600 (Mountain Daylight Time)
    __proto__: Invalid Date
new Date();
Wed Oct 17 2018 09:18:33 GMT-0600 (Mountain Daylight Time)
    __proto__: Invalid Date
new DateTime()
'DateTime' is undefined
new Date()
Wed Oct 17 2018 09:22:01 GMT-0600 (Mountain Daylight Time)
    __proto__: Invalid Date
new Date
Wed Oct 17 2018 09:22:03 GMT-0600 (Mountain Daylight Time)
    __proto__: Invalid Date
Date

function Date() {
    [native code]
}

    [Methods]: {...}
    __proto__: 
function() {
    [native code]
}

    arguments: null
    caller: null
    length: 7
    prototype: Invalid Date

Open in new window

0
Hi Experts,

I am frequently experiencing an error in my SharePoint 2013 on premise environment when users try to upload a document to a document library. When a user uploads a document, the person is asked to fill out two fields (both are lookups). Afterward, the workflow should send the document to a 'To Be Approved' folder. However, this is not happening for 'some' documents so they get stuck. Not every document is failing to move. A developer created a custom Visual Studio workflow so the solution is deployed as a .WSP to the farm. I do not have access to the source code. The attached .PNG file shows the error that is logged in a custom list called 'Logs' in SharePoint. However, I obtained the ULS logs for that time and I have added that below. The build information is Windows Server 2012 R2 (Build 9600​) with SharePoint 2013 v.15.0.4727.1000​​​​​​. Any help / guidance is much appreciated. Further, how can one see the source code in the .WSP file.

Note: Below, I have changed the user's staff id to 'user id' and I have re-named the .pdf file.

ULS Log:
ttidLogWssCellStgConcise [Url: Incoming Documents/test123.pdf][User: i:0#.w|user id (NonCobaltOriginated)][StreamSizes: Request=0 bytes, Response=0 bytes][TotalRequestTime: 16msec][PartitionID: Default][Request: PutChanges **FFU Pri=0 …
0
Hi, I like to use  a brake point for debug.  Never had a problem with it until I started to work on VS 2017 (Professional ).
Now no matter where I put a brake point it is never hit.
Do you have any idea how to fix this?
0
Defend Against the Q2 Top Security Threats
Defend Against the Q2 Top Security Threats

Were you aware that overall malware worldwide was down a surprising 42% from Q1'18? Every quarter, the WatchGuard Threat Lab releases an Internet Security Report that analyzes the top threat trends impacting companies worldwide. Learn more by viewing our on-demand webinar today!

Can you turn on support for Managed as well as Script debugging?  I seems like you can only do one or the other in VS 2015 Community Edition.
0
I cannot get HttpContext to work in ASP.NET Core.


 public string GetCartId()
        {
            if (HttpContext.Current.Session[CartSessionKey] == null)
            {
                if (!string.IsNullOrWhiteSpace(HttpContext.Current.User.Identity.Name))
                {
                    HttpContext.Current.Session[CartSessionKey] = HttpContext.Current.User.Identity.Name;
                }
                else
                {
                    // Generate a new random GUID using System.Guid class.     
                    Guid tempCartId = Guid.NewGuid();
                    HttpContext.Current.Session[CartSessionKey] = tempCartId.ToString();
                }
            }
            return HttpContext.Current.Session[CartSessionKey].ToString();
        }

Open in new window

 Visual Studio keeps coming back with red squiggly lines under the words HttpContext and the Error message "The name 'HttpContext' does not exist in the current context."

As a bit of background, I'm making two big leaps at once: (a) trying ASP.NET Core for the first time and (b) trying to use C# for the first time after years of just VB/asp.net.  I like a challenge!  To help get me there, I'm using a few online guides:
Getting Started with EF Core on ASP.NET Core with an Existing Database
and
ASP.NET Shopping Cart

In effect, I've followed the first link through from starting a blank project to setting up database CRUD pages and tested - all good.  However, when I insert the shopping basket page from the second link, it errors on anything HttpContext related.

In an attempt to fix this, I've followed the suggestions on  ASP.Net Core Session State, added the relevant code hightighted in yellow for the startup.cs page - but to no avail.
0
I'm trying to investigate a problem with resource files generated by Google Omaha. These resource files contain a place-holder token (%1!s!), which is substituted with branding details during the build process. There are numerous language resource files that contains string tables and this

Here is an example string: "%1!s! some arbitrary text"

Where %1!s! is a place-holder for some substitution text?

My question: is this place-holder substitution mechanism a standard part of the Windows resource file mechanism? If so, can someone please either explain how it works? Where does it get the text used to substitute the place holder? I'm assuming the place-holder works similar to place-holders in printf? If so, how does it know which text token to replace this with? If this is not a standard resource file mechanism, does anyone have a clue as to how Omaha does this during the build process?

Many thanks.

Note: I'm not looking for suggestions to use a different approach. This is how Omaha does it and I just need to understand how this works. Thank you.
0
I am teaching myself visual studio with visual basic. Please help a newbie.

I have a connected sql table setup as follows
TABLE [dbo].[Suffix](
      [SuffixID] [int] IDENTITY(1,1) NOT NULL,
      [Suffix] [nvarchar](3) NOT NULL,
      [myCount] [nvarchar](5) NULL,
 CONSTRAINT [PK_Suffix] PRIMARY KEY CLUSTERED

I created a visual basic windows form in visual studio.  the save button on the form as the following code behind it in the click event.
            cmd.CommandType = System.Data.CommandType.Text

            cmd.CommandType = "insert into Suffix values ('" & TextBox30.Text & "', '" & TextBox28.Text & "')"
cmd.Connection = con
            con.Open()
            cmd.ExecuteNonQuery()
            MsgBox("Succesfully added", MsgBoxStyle.Information, "add")
        Catch ex As Exception
            MessageBox.Show(ex.Message)
        End Try

I keep getting the following error Conversion from string "insert into suffix value ('txx'" to type 'integer' is not valid.

How do I fix this?
0
Hi,

Installed : Visual Studio 2017 Community

When I go to "Source Control Explorer" I cannot add folders or files - "New Folder" and "Add Items To Folder" are both greyed.

I have The correct plug-in selected and The TFS database is created.

Anyone know what I need to do please?
0
Is it possible to create an SSIS package in Visual Studio with the Server Name and Data Source in the Source object as a parameter, so that you can provide the SQL server name at runtime?
0
Having bought a new machine (running Windows 10 professional) I Have installed the following:

MS Visual Studio 2017 community
MS SQLServer express 2017
Team Foundation Server express 2015

I find that I do the have the option in VS to "Connect to Team Foundation Server"


I have "Visual Studio Team Foundation Server" set as the Source-Control Plug-in.

I can see my server in Source Control Explorer but cannot add folders or items.

If I go into Team Explorer I can see GIT repos   (dunno how to use these) and I can sometimes add a solution to Source control whereby it is visible in Source Control Explorer temporarily.

How can I connect to TFS correctly in VS 2017 Community please?
0
Installing the Visual Studio 2017 community edition, I realise I need to tidy up my PC in terms of previous Visual Studio installs (see below).  Is it simply a case of uninstalling, via Windows 10 Programs, the older editions, or are their shared programs I should be careful about?Screen grab
0
Visual Studio 2005 crystal reports only shows half of print preview, The right half is faded out...
See attached.

Any ideas?
CR-Report.pdf
0
The Firewall Audit Checklist
The Firewall Audit Checklist

Preparing for a firewall audit today is almost impossible.
AlgoSec, together with some of the largest global organizations and auditors, has created a checklist to follow when preparing for your firewall audit. Simplify risk mitigation while staying compliant all of the time!

How would I call this subroutine from a button click.. passing parameters.

private void SelectionSort(long[] list, int min, int max)
0
I'm not successfully running my subroutine in visual studio code. How can I run this is Visual Studio code?
using System;

namespace SelectSort
{
    class Program
    {
   static void Main(long[] list, int min, int max) {
  int ic;

    long best_value;
    int best_j;
    for (ic = min; ic <= max - 1; ic++)
    {
        best_value = list[ic];
        best_j = ic;
        for (var ji = ic + 1; ji <= max; ji++)
        {
            if (list[ji] < best_value)
            {
                best_value = list[ji];
                best_j = ji;
            }
        }
        list[best_j] = list[ic];
        list[ic] = best_value;
    }

        }
    }
}

Open in new window

0
Hey!

I am developing an application using JetBrains CLion 2018.2.4 with cmake 3.12.2 and Visual Studio 2017 compiler.
Let me set up things first.

Here is the base class:
class Header
{
public:
   enum MessageType
   {
      Message = 100,
      Command = 101,
      InvalidMessage = 102
   };

   Header();
   Header(Header::MessageType messageType);
   virtual ~Header() = default;

   Header::MessageType GetMessageType() const;
private:
   Header::MessageType m_messageType;
};

Header::Header() :
   m_messageType(Header::MessageType::InvalidMessage)
{
}

Header::Header(Header::MessageType messageType) :
   m_messageType(messageType)
{
}

Header::MessageType Header::GetMessageType() const
{
   return m_messageType;
}

Open in new window


Here is the derived class:
class Message : public Header
{
public:
   Message();
   ~Message() = default;

   void SetMessage(std::string message);
   std::string GetMessage() const&;

private:
   std::string m_message;
};

Message::Message() :
   Header(Header::MessageType::Message),
   m_message("")
{
}

void Message::SetMessage(std::string message)
{
   m_message = message;
}

std::string Message::GetMessage() const&
{
   return m_message;
}

Open in new window


Here is how I'm acessing the function GetMessage();
int main()
{
   Reader reader;

   auto basePtr = reader.ReadAll(message);
   auto derivedPtr = std::dynamic_pointer_cast<communication::Message>(basePtr);
   std::cout << "read: " << derivedPtr->GetMessageType() << ";" << derivedPtr->GetMessage();
}

Open in new window


When I try to execute GetMessage() like up above, I get the error below:

Server.cpp.obj : error LNK2019: unresolved external symbol "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall communication::Message::GetMessageA(void)const & " (?GetMessageA@Message@communication@@QGBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) referenced in function _main
Server.exe : fatal error LNK1120: 1 unresolved externals

Open in new window


It has to do with the function GetMessage() but I'm failing to see what is wrong. If I remove that call, everything compile fine.
Also, I do the exact same call in other class and it is working fine.
Help is needed!!!
0
Hi,
I've just installed Microsoft SQL Express as well as Server Management Studio and Visual Studio.
However when I open the Management Studio and connect and create a database it displays it with a black lock icon.
Is this normal ?
My question is:  Why, when I right click on the selected database and click tasks why are both Import and Export options greyed out. ?
Thanks for your help
Ian
0
I'm trying to get the op numbers from the following filename strings using RexEx which the pattern will be used in VS2017 using the C# language for developing a Windows Form Application. In this application, we are filtering filenames in a datagridview by Op number when searching through a folder directory and all its subdirectories. I'm having an issue trying to get the regex to work on the tester websites I have tried. These are regxr.com and regexstorm.net/tester

Filename1: C-2590-3 REV-B OP#50.pcl
Filename 2: C-2590-3 REV-B OP#50-59.pcl
Filename 3: C-2590-3 REV-B OP#50-59-90.pcl
Filename 4: C-2590-3 REV-B OP#50-59-90-70(Flip).pcl
Filename 5: C-2590-3 REV-B OP#50-59-90 (Flip)60-90.pcl

The text I need to capture is :

Filename 1 Results: 50
Filename 2 Results: 50-59
Filename 3 Results: 50-59-90
Filename 4 Results: 50-59-90-70
Filename 5 Results: 50-59-90 60-90

This is what I have tried on the regexr.com tester:

(?<=\043)\d{2}|(?<=\043)\d{2}.\d{2}|(?<=\043)\d{2}.\d{2}.\d{2}

(?<=#)\d{2,}|(?<=#)\d{2,}.\d{2,}|(?<=#)\d{2,}.\d{2,}.\d{2,}

and I keep getting stuck because it will only show me the 1st two digits "50"

I'm not real familiar with Regex and I thought I should get some help because I'm missing something And don't know what that might be.

Can anyone help with this? Here is a screenshot of the form application running.

Tesa File Search - Screenshot1
0
I need assistance publishing our web application to our FTP using Visual Studio 2017.

I tried reading the instructions on the Microsoft website on how to do it but I am not well-versed to do it without assistance.

Please help.
0

Microsoft Visual Studio

743

Solutions

790

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.