Microsoft Visual Studio





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 trying to build a Visual Studio VB WindowsForm project that uses DAO to access a 2016 .accdb database file.

I have added the reference Microsoft.Office.Interop.Access.Dao from the Access.16 Office dll.

My code:

Option Explicit On
Imports DAO = Microsoft.Office.Interop.Access.Dao
Module Module1LoopThroughStandard
    Public Sub LoopThrough()
        Dim de As New DAO.DBEngine
        Dim db As DAO.Database
        Dim rs As DAO.Recordset
        Dim strSQL As String

        db = de.OpenDatabase("c:\Project\database.accdb")

        strSQL = "SELECT * " & _
                   "FROM Table1"

        rs = db.OpenRecordset(strSQL)
        With rs
            If .BOF Then
                MsgBox("Oops, not working")
            End If
        End With

        rs = Nothing
        db = Nothing
        de = Nothing

    End Sub
End Module

Open in new window

I get the following COM Exception:

System.Runtime.InteropServices.COMException was unhandled
  Message=Retrieving the COM class factory for component with CLSID {CD7791B9-43FD-42C5-AE42-8DD2811F0419} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
       at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, …
Introducing the "443 Security Simplified" Podcast
Introducing the "443 Security Simplified" Podcast

This new podcast puts you inside the minds of leading white-hat hackers and security researchers. Hosts Marc Laliberte and Corey Nachreiner turn complex security concepts into easily understood and actionable insights on the latest cyber security headlines and trends.

What is the difference between ASP.NET Web Application Visual C# (.NET Framework) and ASP.NET Web Application(.NET Framework) Visual Basic when it comes to developing a web page.  I am trying to convert a desktop VB6 application and want to start off on the right ASP development page.  I am in the process of learning Visual Basic again.  

Also, I see a .NET Core version, so what exactly am I looking at as this can be quite confusing as to where I should begin?
In Visual studio, is it possible to make a Windows Form Desktop application that can also be executed from a Mac?  Or can that only be done from making a web page such as ASP.NET Web Application
Unable to run the WPF application from windows startup. Do I need to specify the application startup folder or application folder in the config file?
My setup is located in d:\app\crm\ folder. But my desktop shortcut is working fine.

Registry: setup


value name: CRM-DEMO
value data: "d:\app\crm\crm.exe"
OS : Windows 10
I have a c# windows form project. I want the form to maintain the aspect ratio if the user grabs the resize grip in bottom corner. In other words for the form to resize diagonally only. Does anyone have a sample code or class to perform this?

I am using Visual Studio 2017 pro with a c# .NET 4.6.2 winform project.
Windows Forms template missing after installing Visual Studio Community 2017. I installed the .Net Development Environment along with the Universal Windows Platform Development. When I did the installation I did chose Run as Administrator.  What can I try to be able to create new Windows Forms applications? If necessary, I will uninstall the whole thing and start over.  I did just download the latest VS Community 2017 install package.
I am using desktop version, need to convert a excel sheet to csv.
Need to calculate the used range of excel and convert it into comma seperated csv.

***Please note speed is an issue here, if you suggest any code with high performance it will be appreciated the most.
I need help with creating an expression that will change the font color and make it bold based on if the field is less than today's date.  I am using Visual Studio 2012.  I have a datetime field that I only want to filter on the date.

The last expression I attempted was =iif(Fields!estimated_date.Value < GetDate(), 'Red', 'Black'   I get an error GetDate is not delcared.
When I try to open a project in Visual Studio 2017 I get the following error.

C:\Users\rgtur\Desktop\Tarabu\Tarabu\Tarabu.vbproj : error  : The project file could not be loaded. Data at the root level is invalid. Line 1, position 1.  C:\Users\rgtur\Desktop\Tarabu\Tarabu\Tarabu.vbproj

How do I fix this?
How to export a image column of sql server to PDF/word  in
I am using visual studio 2017 windows version.

Problems using Powershell and Active Directory?
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

I have created a program to make some XML files used to export data from our local system to another system. I used xsd.exe on Visual Studio 2010 to generate C# classes based on XSD schemas that I received from the other system. One of the types of data that are exported are clients. Now, the problem is that the XML files contain too much data. They have this structure (I have replaced some of the data with xx to not leak sensitive client data):
<?xml version="1.0" encoding="utf-8"?>
<ROWSET xmlns:xsi="" xmlns:xsd="" xmlns="Clients">
   <CLIEZIP />

Open in new window

I want to have only the <ROW></ROW> data, not the <BI_CLIENTS>  </BI_CLIENTS> data, so that the data can be imported correctly in the other system. I have attached the code for the generated C# class.
Please help. I am not asking for at complete solution, just for some help to find the right place to change the code.
Software: Visual Studio and SQL Server 2005.
On clickonce deployment I get this error: The aplication requires assembly System.IdentityModel Version be installed in the GAC.

Can someone tell me what is required?

My SSIS package needs to run on the last working day of the month, so I have created a lookup table that returns a row when the systemdate matches the calculated month end date which returns 1 row. When it is not month end, 0 row is returned.

With this I have created a variable (on success) to run the other packages.
However, I need suggestions on how to implement ending the execution without errors when the condition is not met (as the job will be scheduled to run daily).

See attachment for info.
Thank you
How to delete empty rows in a mail merge Word from desktop app.

I have code for removing fields :

  Sub RemoveBlankFields(ByVal doc As Object, ByVal StrToReplace As String)

        Dim wdApp As Object 'Word.Application
        Dim Unit1 As Microsoft.Office.Interop.Word.WdUnits = Microsoft.Office.Interop.Word.WdUnits.wdLine

        'Dim doc As Word.Document
        'Set wdApp = doc.Application
        wdApp = doc.Application
        wdApp.Selection.Find.Text = StrToReplace
        Dim wdCharacter As Object = Unit1.wdCharacter
        Dim wdExtend As Object = Word.WdMovementType.wdExtend

        Do While wdApp.Selection.Find.Execute(FindText:=StrToReplace, Forward:=True,
                    Format:=True) = True
            With wdApp.Selection
                ' .Expand(Unit1)
                ' .Delete
                .HomeKey(Unit1, missing)
                .MoveDown(Unit1, 1, wdExtend)
                .Delete(wdCharacter, missing)
            End With
    End Sub

Open in new window

Hi, I am executing a stored procedure using an OLE DB Source inside a data flow task.
The SP contains 3 global temp tables (e.g, ##temptable1) but the task returns an error as it cannot find the target table in the database.
As a test, I have changed the SP to use CTE but the query runs too long and therefore need temp tables.

Please advise how can I overcome this by using global temp tables?
Let me know if further information is needed.

Thank you
Public Class Form2
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        TextBox2.MaxLength = 8
        TextBox2.Text = TextBox1.Text
    End Sub
End Class

Open in new window

Hi, I want to copy textbox1 to textbox2 but limit it's maxlength to 8 characters only
Note that textbox1.text may contain 9 characters and above

ABCDEFGHIJKLMN123456 should be ABCDEFGH only

Thank you
I design c#programe by use visual studio and my sql tables
I need to export this programe to setup programe to use in other pc's without need to setup sql and vs
Only set up this icon of programe and this setup add sql tables to alocation which i sellect forcexample in E partition not C partion and i need many users to work share in this programe by sumple home network
I was successful in creating a database of access through code. But, I don't know how to set a column property to auto increment. I tried `.Item("Key").Properties("AutoIncrement").Value = True` But no success. It prompts me an error.


Item cannot be found in the collection corresponding to the requested name or ordinal.

Imports ADOX 
Imports ADOX.DataTypeEnum
Imports System.Data.OleDb
Imports System.Data.SqlClient

           Private Sub Button11_Click(sender As Object, e As EventArgs) Handles Button11.Click
        Dim DB1_file_name As String = "\DB3.mdb"
        Dim catDB As ADOX.Catalog
        Dim tblNew As ADOX.Table
        Dim catstring As String

        catDB = New ADOX.Catalog
        ' Open the catalog.
        'catDB.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Application.UserAppDataPath & "\DB1.mdb"
        catstring = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Application.UserAppDataPath & DB1_file_name
        If Not File.Exists(Application.UserAppDataPath & DB1_file_name) Then
            'catDB.ActiveConnection = catstring
        End If

        tblNew = New ADOX.Table
        ' Create a new Table object.
        With tblNew
            .Name = "Contacts"
            ' Create fields and append them to the
            ' Columns collection of the new Table object.
            With .Columns

Open in new window

For my Gridview, i want it to display (Prospective), (Individual Associate) or (Corporate Associate).  It displays (Prospective) and (Individual Associate), but the sql takes Org_Id as Person_Id and the (Corporate Associate) label cant work !!

aspx code
                <asp:GridView CssClass="table table-hover BlueTable" ID="gvProspective" runat="server" EmptyDataText="No Records Found" ShowHeaderWhenEmpty="true" AutoGenerateColumns="false" GridLines="None" UseAccessibleHeader="true" BorderStyle="None">
                <asp:BoundField DataField="PERSON_ID" ItemStyle-CssClass="hiddencol" HeaderStyle-CssClass="hiddencol" />
                <asp:BoundField DataField="ORG_ID" ItemStyle-CssClass="hiddencol" HeaderStyle-CssClass="hiddencol" />
                <asp:Label ID="lblname" runat="server" Text='<%#Eval("FULLNAME_NAMETAGS")%>' ></asp:Label>
                <asp:label ID="lblPros" runat="server" Text="(Prospective)" Visible='<%#bool.Parse(HasExistingProspective((int)(Eval("PERSON_ID")))) %>' />
                 <asp:label ID="lblIA" runat="server" Text="(Individual Associate)" Visible='<%#bool.Parse(HasExistingIA((int)(Eval("PERSON_ID")))) %>'/>
                <asp:label ID="lblCA" runat="server" Text="(Corporate Associate)" Visible='<%#bool.Parse(HasExistingCA((int)(Eval("ORG_ID")))) %>'/>

Open in new window

Cloud Class® Course: SQL Server Core 2016
LVL 12
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

I am using visual Studio 2015.  ASP.NET using  I have a hyperlink field that I want to bind to a database field.  I was able to bind the field but when I click on the field it adds to the url the full path of the apsx. page.  I just want the URL

For example.  The database field value is  When I bind the hyper link and it is clicked on in the site, it links to

http://intranet2/account/   I just want it to go to

<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Bind("website") %>' Text='<%# Bind("website") %>'></asp:HyperLink>
Hi All,
Advance thanks!
Am using visual studio 2017 and C#. I am showing the dialog1 (rendering cshtml) when i click button 1 in page 1.  Inside popup html (dialog1)am having button2.

When i click button 2 in popup, i suppose to close popup and refresh page1. I can close the popup but i  am having trouble to refresh parent page...

      $(document).ready(function () {
                  autoOpen: false
      function Signature() {
             var valueCell = 'test';
              $.get('@Url.Action("AttachDocSignature", "Amendments")', { param1: valueCell }, function (partialView) {

dialog 1 renders another .cshtml page which has button2 , If i click button2 , i can close the dialog but how to refresh page1

Kind regards,

I have created a windows form application where I am connecting to a database. The database connection string is currently stored in the App.config file, but the string is stored as plain text. Which is not good as the DB password is readable and therefore vulnerable.

Please could you advise the best approach on how to secure the connection string? The application will be used on multiple machines but ran from a single shared location (not installed on each machine).

My thought was to create a separate application that would convert the connection string to an encrypted string using a password. The decrypt function would be added to the end user application and the encrypted string copied and pasted into the app.config. Using the encryption key along with the decrypt function the end user app should be able to decrypt the connection string.

My issue is that I do not know what type of encryption to use or which type in .NET is the newest.

I am using .NET Framework 4.6.

Please could you help and provide examples as encryption is new to me...

Thanks, Greg
I have been assigned  a task to develop  photoshop  sdk in VC++.I  want  photoshop sdk for C++.I  want  to  know  how to use  it?

I  googled  lot of  pages  ,adobe  site  but unable  to download exact C++  sdk and its tutorial.I  created  Adobe  login also  but unable to find where is SDK  download.

I also want help on  how  to  use  that sdk.I am  proefficent with VC++.But  don't know  photoshop. Please  help regarding it.
Baby steps into .NET Core

I'm a CE.NET developer who has worked on the full .NET stack, including MVC. I used to program Windows applications using Win Forms.

What do you suggest as my first baby steps into .NET Core?

My intention is to create a cross-platform application for Windows, Mac and UNIX, but I prefer coding in Mac, if possible.

I do have Visual Studio Code on my MacBook, but I also have a Windows partition.

What options to I have for development platform?

What steps do I need to take before I can write my first Hello World application?

I have .rdl files which I have added into the reports in the solution explorer and then I have datasets in the report data. On the basis of datasets when I preview I get some options to select and then I am able to get the data fetched from the database (ssrs). I need to generate a table when I select options while previewing. I am getting data from 2 tables. I know there can be various ways to approach this. I might need to write expressions in the reports or some other way. Can anyone help me getting started with how to build dynamic tables in reports?

Microsoft Visual Studio





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.