Microsoft Visual Studio

271

Solutions

345

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

We will install a visual studio version, probably 2015 or 2017 so that we can be ready for the present someday in the future. But for now we have to deliver our source code to the customer who only knows about Iso c++03.

This means that if a developer inserts some newer c++11/14 constructs into our code base, then I want the computer to issue fatal errors forcing the developer to have to conform to c++03.

I found this link that does not appear to go back far enough in time.
https://msdn.microsoft.com/en-us/library/mt490614.aspx

If you have an answer, please provide a relevant link that supports your response so that I can show my manager. Thanks.

Using Windows 10.
0
Prepare for your VMware VCP6-DCV exam.
LVL 1
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

If user selects 5 on ddl and only 4 event participants are displayed, there will be a label asking user to select qty that is lower!! Now, when I click the button nothing changes and there is also a line underlining eventParticipants.
- The end of the cookies line are red too, and I think there is a problem with the image.url part?
code behind for the button
  protected void btnAdd_Click(object sender, EventArgs e)
    {
        var id = Convert.ToInt32(lblItemNr.Text);
        SqlConnection con = new SqlConnection(_connStr);
        if (con.State == ConnectionState.Open)
        {
            con.Close();
        }
        con.Open();
        SqlCommand cmd1 = con.CreateCommand();
        cmd1.CommandType = CommandType.Text;
        cmd1.CommandText = "update EventDetail set eventParticipants=eventParticipants-" + ddlAmount.Text + " where EventDetail_ID=" + id;
        cmd1.ExecuteNonQuery();
        Response.Redirect("Detail.aspx?id=" + id.ToString());
        //below are the codes with problems (eventParticipants)...
        if(Convert.ToInt32(ddlAmount.Text) > Convert.ToInt32(eventParticipants))
        {
            l1.Text = "please enter lower quantity";
        }
        else
        {
            l1.Text = "";

            if (Request.Cookies["aa"] == null)
            {
                Response.Cookies["aa"].Value = lblTitle.Text.ToString() + "," + lblPrice.Text.ToString() + "," + lblDate.Text.ToString() + "," + lblLocation.Text.ToString() + "," + 

Open in new window

0
1. When I click edit, I have to click it twice in order for the edit to work
2. Then shows the update, but all the items are not shown and when I click update -> it says 'result = det.EventDetailUpdate(int.Parse(id), int.Parse(tid), tname, tdate, decimal.Parse(tprice), tdesc, tlocation, tstart, tend, timage, int.Parse(tparticipants)); 'input string is not in correct format
what I did to update!!
   protected void abind()
    {
        List<EventDetail> detList = new List<EventDetail>();
        detList = aDet.getAllEventDetail();
        gvDetail.DataSource = detList;
        gvDetail.DataBind();
        //   ViewState["grdDetailsDataSource"] = (List<EventDetail>)gvDetail.DataSource;
    }  protected void gvDetail_RowEditing(object sender, GridViewEditEventArgs e)
    {
        gvDetail.EditIndex = e.NewEditIndex;
     //   abind();
    }
    protected void gvDetail_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
    {
        gvDetail.EditIndex = -1;
      //  abind();
    }
    protected void gvDetail_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        int result = 0;
        EventDetail det = new EventDetail();
        GridViewRow row = (GridViewRow)gvDetail.Rows[e.RowIndex];
        string id = gvDetail.DataKeys[e.RowIndex].Value.ToString();
        string tid = ((TextBox)row.Cells[2].Controls[0]).Text;
        string tname = ((TextBox)row.Cells[3].Controls[0]).Text;
        string tdate = ((TextBox)row.Cells[4].Controls[0]).Text;
 

Open in new window

0
I would like in my Visual Studio vb.net or c# project a way to link to code methods that it impacts. Is this possible in Sandcastle?
0
eg. I have 20 participants. When I select 2qty and click the button, it is supposed to have 18 participants!! However now when I click the button, the qy changes to 0 , and all the other participants no. for other events will change too..
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        var id = Convert.ToInt32(lblItemNr.Text);
    SqlConnection con = new SqlConnection(_connStr);
        if (con.State == ConnectionState.Open)
        {
            con.Close();
        }
        con.Open();
        SqlCommand cmd1 = con.CreateCommand();
        cmd1.CommandType = CommandType.Text;
        cmd1.CommandText = "update EventDetail set eventParticipants=eventParticipants-" + lblParticipants.Text;
        cmd1.ExecuteNonQuery();
        Response.Redirect("Detail.aspx?id=" + id.ToString());   
    }

Open in new window

0
I'm trying to filter a gridview from a gridview with checkboxes!! I have this error at
' if (chk.Checked)'
Below is part of the code!!

  private void BindGrid()
    {
        string constr = ConfigurationManager.ConnectionStrings["EventContext"].ConnectionString;
        string query = "SELECT EventDetail_ID, EventType_ID, EventDetailName, eventDate, eventPrice, eventDesc, eventLocation, startTime, endTime, eventImage, eventParticipants FROM EventDetail";

        string condition = string.Empty;

        foreach (GridViewRow row in grdDetails.Rows)
        {
            CheckBox chk = (CheckBox)row.FindControl("chkSelect");
            if (chk.Checked)
            {
                string eventtypeid = row.Cells[0].Text;   
                // i am trying to get the bounded field value of eventtype ID field here
                condition += string.Format("'{0}',", eventtypeid);
            }
        }
        if (!string.IsNullOrEmpty(condition))
        {
            condition = string.Format(" WHERE EventType_ID IN ({0})", condition.Substring(0, condition.Length - 1));
        }
        using (SqlConnection con = new SqlConnection(constr))
        {
            using (SqlCommand cmd = new SqlCommand(query + condition))
            {
                using (SqlDataAdapter sda = new SqlDataAdapter(cmd))
                {
                    cmd.Connection = con;
                    using (DataTable dt = new DataTable())
                    {
                        

Open in new window

0
Below is my code behind. When I click the add to cart button, the qty(eventParticipants) should decrease but it doesn't. Also, it says the name id does not exist in the current context for the id in the btnAdd_Click part below~~

 string _connStr = ConfigurationManager.ConnectionStrings["EventContext"].ConnectionString;

    protected void Page_Load(object sender, EventArgs e)
    {
        FillPage();
    }
    private void FillPage()
    { 
        if(Request.QueryString["id"] == null)
        {
            Response.Redirect("Events.aspx");
        }
        else
        {
            //get selected event's data
            if (!String.IsNullOrWhiteSpace(Request.QueryString["id"]))
            {
                int id = Convert.ToInt32(Request.QueryString["id"]);

                EventDetail Detail = new EventDetail();
                EventDetail detail = Detail.getEventDetail(id);
                if (detail == null)
                {
                    Response.Write("<script>alert('No event found');</script>");
                    return;
                }
                //fill pg w data
                lblDate.Text = detail.eventDate;
                lblLocation.Text = detail.eventLocation;
                lblStartTime.Text = detail.startTime;
                lblEndTime.Text = detail.endTime;
                lblParticipants.Text = detail.eventParticipants.ToString();
                lblPrice.Text = "$" + detail.eventPrice;
                lblTitle.Text = 

Open in new window

0
I Need some help with Visual Studio, I have a project file that was made in VS2008 and I need it to work in a newer version (2012)
0
Im trying to get checkboxes in one gridview to filter to another gridview. I think I got this error because of ' (ListItem item in chkSelect.Items)' when I didn't use checkboxlist. What do I change in the codes??


 <asp:GridView ID="grdEventType" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" BackColor="White" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" CellPadding="3" DataKeyNames="EventType_ID" datasourceid="sdsEventType" ForeColor="Black" GridLines="Vertical" Width="50%" OnSelectedIndexChanged="grdEventType_SelectedIndexChanged">
            <AlternatingRowStyle BackColor="#CCCCCC" />
            <Columns>                                    
                <asp:TemplateField HeaderText="Select">
        <HeaderTemplate>
            <asp:CheckBox ID="chkAll" runat="server" onclick="javascript:SelectAllCheckboxes(this);" />
    </HeaderTemplate>
    <ItemTemplate>
       <asp:CheckBox ID="chkSelect" runat="server"AutoPostBack="true" OnSelectedIndexChanged="Type_Selected" />
    </ItemTemplate>
   </asp:TemplateField>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True"/>
                <asp:BoundField DataField="EventType_ID" HeaderText="EventType_ID" ReadOnly="True" SortExpression="EventType_ID" />
                <asp:BoundField DataField="EventTypeName" HeaderText="EventTypeName" SortExpression="EventTypeName" />
            </Columns>
            <FooterStyle BackColor="#CCCCCC" />

Open in new window

0
I'm new to, and using Git. I have my remotes/origin branch of "master" that contains all production-ready code.

From "master", I create a new local branch called "Bug Fixes".

When I try to push code changes in Bug Fixes back to "master", I get this error every time:

Error encountered while pushing to the remote repository: Not a valid reference 'origin/master'

Maybe I'm not using this correctly? Can someone please advise?
0
What is SQL Server and how does it work?
LVL 1
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

I'm getting the following error when I'm working in Visual Studio Professional 2017 Version 15.2

System.InvalidOperationException: 'The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.'

How do I fix this?
Which Access Database Engine Redistributable must I download to fix this?

I'm running Microsoft Office 365
0
I am considering building a new application using C# 7.  I was researching building a licensing component.  I would envision licensing my software for a year at a time.  

I have found numerous articles on free solutions that I can implement, however many of them are 10+ years old!  I wanted to see if anyone had suggestions on how I could go about this.

As a reference, I did find this article which looks good.  However, it is from 2005, therefore I wanted to check the community to see if there was a “newer and better” way to accomplish this.

https://www.codeproject.com/Articles/11012/License-Key-Generation
0
Hello Experts.

I've been wanting to a add a really nice looking pop-up that shows temporarily for a set number of seconds then doesn't show again while the program is running. I'm only able to get it to partially show on the screen. The fantasy was to have something that floats up then goes away, but that's more of a WPF thing and I am only working with a basic Windows Form. I'm thinking perhaps the System.Threading.Thread.Sleep function is causing the problem, but I'm not sure how else to do this.

To help with understanding my issue, I have created a quick Demo solution that should suffice for its purpose. Please note that I still don't have WinZip, so the attached file is actually a .RAR file renamed to have a .ZIP extension so the EE uploader would take it.

BTW, I found a pretty decent solution that also uses System.Threading.Thread.Sleep but it uses the MsgBox function, and not a custom form which is what I want to do. Nevertheless, it does work. This is the code for that solution. If we can just swap out the standard dialogue with mine, that would be great!

Module FormUtils
    Private sAutoClosed As Boolean
    Private Sub CloseMsgBoxDelay(ByVal data As Object)
        System.Threading.Thread.Sleep(CInt(data))
        SendKeys.SendWait("~")
        sAutoClosed = True
    End Sub
    Public Function MsgBoxDelayClose(prompt As Object, ByVal delay As Integer, Optional buttons As MsgBoxStyle = MsgBoxStyle.ApplicationModal, Optional title As 

Open in new window

0
I'm currently using Visual Studio Code. How can I use Visual Studio Code along-side my web browser to code in real-time and see the changes in real-time? Brackets have "Live in Preview", not seeing this in Visual Studio Code.
0
No checkbox is being shown for the Select/Unselect ALL checkbox at the header template. Also when I run, all the checkbox is already supposed to be checked !

Here is the aspx codes
 
<asp:GridView ID="grdEventType" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" BackColor="White" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" CellPadding="3" DataKeyNames="EventType_ID" datasourceid="sdsEventType" ForeColor="Black" GridLines="Vertical" Width="50%" OnSelectedIndexChanged="grdEventType_SelectedIndexChanged">
            <AlternatingRowStyle BackColor="#CCCCCC" />
            <Columns>
                                       
                <asp:TemplateField HeaderText="Select">
        <HeaderTemplate>
        <input id="chkAll" onclick="javascript:SelectAllCheckboxes(this);"
            runat="server" type="checkbox" />
    </HeaderTemplate>
    <ItemTemplate>
       <asp:CheckBox ID="chkSelect" runat="server" />
    </ItemTemplate>
    <HeaderTemplate>
    </HeaderTemplate>
   </asp:TemplateField>

                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True"/>
                <asp:BoundField DataField="EventType_ID" HeaderText="EventType_ID" ReadOnly="True" SortExpression="EventType_ID" />
                <asp:BoundField DataField="EventTypeName" HeaderText="EventTypeName" SortExpression="EventTypeName" />
            </Columns>
            <FooterStyle BackColor="#CCCCCC" />
            

Open in new window

0
The word Review order is in blue. It is supposed to be white!! And the border surrounding all of this should be grey but it is blue too
Aspx code
<div class="panel panel-info">
                        <div class="panel-heading">
                            Review Order <div class="pull-right"><small><a class="afix-1" href="#">Edit Cart</a></small></div>
                        </div>
                        <div class="panel-body">
                             <div class="col-md-12">
                                    <strong>Subtotal (# item)</strong>
                                    <div class="pull-right"><span>$</span><span>Wait 4 Cart</span></div>
                                </div>
                                <div class="col-md-12">
                                    <small>Tax</small>
                                    <div class="pull-right"><span>-</span></div>
                                </div>
                                <div class="col-md-12">
                                    <small>Shipping</small>
                                    <div class="pull-right"><span>-</span></div>
                                    <hr/>
                                </div>
                                <div class="col-md-12">
                                    <strong>Order Total</strong>
                                    <div class="pull-right"><span>$</span><span>Cart</span></div>
                                    <hr/>
           

Open in new window

0
I created a form to insert data. I want the event detail id and location to be in the same line, event detail name and start time to be in the same line and so on to make the page easier to use. but now all the fields are on the left!!

event detail id and event detail name part
 <div class="container">
        <div class="form-horizontal">
            <h4>Insert Event Detail</h4>
            <hr />
           
            <div class="form-group">
            <asp:Label ID="detID" runat="server" CssClass="col-md-2 control-label" Text="Event Detail ID:"></asp:Label>
               <div class="col-md-3">
                    <asp:TextBox ID="txtId" CssClass="form-control" runat="server" placeholder="Enter Detail ID"></asp:TextBox>
                   <asp:RequiredFieldValidator ID="rfvID" CssClass="text-danger" runat="server" ErrorMessage="The ID field is Required !" ControlToValidate="txtId"></asp:RequiredFieldValidator>
                    </div>
            </div>
                 <div class="form-group">
            <asp:Label ID="detName" runat="server" CssClass="col-md-2 control-label" Text="Event Detail Name:"></asp:Label>
               <div class="col-lg-3">
                    <asp:TextBox ID="txtName" CssClass="form-control" runat="server" placeholder="Enter Detail Name" ></asp:TextBox>
                   <asp:RequiredFieldValidator ID="rfvPassword" CssClass="text-danger" runat="server" ErrorMessage="The Name field is Required !" 

Open in new window

0
I had been testing out an eval of SQL Server 2016, with doing this the eval expired and I we purchased a copy of SQL Server 2016 Std. I am able to see the tables through Microsoft SQL Server Management Studio.

The projects that I'm building are tabular models in Visual Studio. When I try to deploy my project I get "cannot deploy metadata. Reason an error occurred while connecting to the server".

The SQL Server is running on Server 2012 Standard. I'm using Visual Studio 2017. Everything was working fine prior to having to uninstall SQL Server 2016 Eval and putting in the Paid edition. This SQL Paid edition is on the exact machine that the Eval Edition was on.

 Any Help would be appreciated.
0
In asp.net I had in my app_code a file called CommerceLib and it worked. I copyed it into a c# program and it can not fine the using CommerceLib.

Below is the code of the main file I am trying to use:

using CommerceLib;

namespace CommercelLib
{
    /// <summary>
    /// Summary description for OrderProcesor
    /// </summary>
    public class OrderProcesor
    {
        internal IPipelineSection CurrentPipelineSection;
        internal bool ContinueNow;
        internal CommercelLibOrderInfo Order;

        public OrderProcesor (string OrderId)
        {
            // get order
            Order = commercelLibAccess.GetOrder(OrderId);
        }

        public OrderProcesor(CommercelLibOrderInfo OrderToProcess)
        {
            // get order
            Order = OrderToProcess;
        }

        public void Process()
        {
            // configure processor
            ContinueNow = true;

            // log start of execution
            CreateAudit("Order Processor started", 1000);

            // process pipeline section
            try
            {
                while (ContinueNow)
                {
                    ContinueNow = false;
                    GetCurrentPipeLineSection();
                    CurrentPipelineSection.Process(this);
                }
            }
            catch (OrderProcessorException ex)
            {
                MailAdmin("Order Processing error occurred.", ex.Message, ex.SourceStage);
                

Open in new window

0
Free learning courses: Active Directory Deep Dive
LVL 1
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

I am trying to write a C# application that will load a form, fill in values, and submit it. Then I'd like to do it again (to the resulting form that's loaded after the login event). Essentially the first page load will be a login form (which I can specify credentials for) and then I'd like to click a button on the resulting page and answer affirmative to the pop-up that comes up.

Is this possible with an HttpWebRequest or something similar?
0
I am trying to debug using Visual Studio. I am able to attach to the w3wp.exe file on the server. When I go to set a breakpoint I receive the message:
The breakpoint will not currently be hit. No symbols have been loaded for this document.

I have dragged all the files from the server (we are using Epicor ERP):
\server\E10Web\E101SWTestApp\Server\BPM\Sources\BO\JobEntry.ChangeJobHeadProdTeamID\XXX
folder into visual studio.

The web.config on the server has been changed to: loadPdb="true"

Has anyone come across this problem and found a solution to it?
0
When I try to run a web application inside the Visual Studio 2017 IDE I get the following error.

System.InvalidOperationException: 'The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.'

What's even more interesting.  I don't get this error when I work on a Win App.  Everything works fine.

How do I manually register the component?
Capture.PNG
0
is there an easy way to test a c# libary class. I have it linked to another c# program but need a way to check the class. Using visual studio 2015
0
Hello Experts.

Yesterday, I took on the challenge of assembling a record for my Match table, and writing it to the table. I thought perhaps it best to use a String array to store the data, then add it as a single DataTable row. Here's the code that I have right now:
Private Sub NineBallRack_Click(sender As Object, e As EventArgs) Handles NineBallRack.Click
    ' Clicking the Nine Ball Rack icon officially starts the match!
    Dim MsgOpts As MsgBoxStyle = vbOKCancel + vbQuestion + vbDefaultButton2
    Dim MsgText As String = "Click OK to Start the Match, or Cancel to return."
    If MsgBox(MsgText, MsgOpts, "SNAP - Start Match") = vbOK Then
        Call BuildMatchRecord()
        If ReturnArray IsNot Nothing Then
            Dim dtMatch As DataTable = Me.SNAPDataSet.Match
            dtMatch.NewRow()
            dtMatch.Rows.Add(ReturnArray)
            ReturnArray = Nothing
            'Call BindingNavigatorSave_Click(Me.DataMatchSave, Nothing)
        End If
    End If
End Sub

Open in new window


Note that the call to BindingNavigatorSave was commented out since it was throwing an error, so I thought it best just to focus on getting this first part working, then tackle that part later.

Here is what Sub BuildMatchRecord looks like, with comments describing the various fields:
Private Sub BuildMatchRecord()
    ReturnArray = Nothing
    ' Match Table Uses the Following Schema:
    '     0: Match_Key (yyMMddHHmm)
    Dim MatchKey As String = 

Open in new window

0
It does not show the searched items when I type in a name.

What I did to search for aspx
 <input type="text" class="field" id="searchtextbox"/>
 <input type ="button" class="search-submit" value="Search" onclick="search();"/>
 <script type ="text/javascript">
            function search() {
                window.location = "Events.aspx?search=" + document.getElementById("searchtextbox").value;
            }  
        </script> 

Open in new window

Code behind. Those bolded are what I did to search
protected void Page_Load(object sender, EventArgs e)
    {
        SqlConnection con = new SqlConnection(_connStr);
        con.Open();
        SqlCommand cmd = con.CreateCommand();
        // event types
        string sql = "Select * from [EventType] order by 1";
    cmd.CommandText=sql;
      DataTable dtet = new DataTable();
    SqlDataAdapter daet = new SqlDataAdapter(cmd);
    daet.Fill(dtet);
      dd.DataSource = dtet;
      dd.DataBind();

      // events
      int EventTypeID = 0;
      if (Request.QueryString["type"] != null)
        EventTypeID = Convert.ToInt32(Request.QueryString["type"].ToString());
      if (EventTypeID == 0)
        sql = "select * from EventDetail order by EventDetail_ID";
      else
        sql = "select * from EventDetail where EventType_ID=" + EventTypeID.ToString() + " order by EventDetail_ID";

   if(Request.QueryString["type"] != null && Request.QueryString["search"] != null)
        {
            sql = "select * from EventDetail where =eventDetailName like('% " + Request.QueryString["search"].ToString() + "%')";

        }

        cmd.CommandText=sql;
      DataTable dte = new DataTable();
    SqlDataAdapter dae = new SqlDataAdapter(cmd);
    dae.Fill(dte);
          d1.DataSource = dte;
          d1.DataBind();
          con.Close();
    }
0

Microsoft Visual Studio

271

Solutions

345

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.