Microsoft Visual Studio

700

Solutions

743

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 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")
            Else
                .MoveFirst()
                MsgBox(.Fields("Name"))
            End If
            .Close()
        End With

        rs = Nothing
        db.Close()
        db = Nothing
        de = Nothing

    End Sub
End Module

Open in new window


I get the following COM Exception:

System.Runtime.InteropServices.COMException was unhandled
  ErrorCode=-2147221164
  HResult=-2147221164
  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)).
  Source=mscorlib
  StackTrace:
       at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, …
0
Introducing the "443 Security Simplified" Podcast
LVL 1
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?
0
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
0
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

Computer\HKEY_USERS\S-1-5-21-46785309-178999357935128-15119887777187849-1001\Software\Microsoft\Windows\CurrentVersion\Run

value name: CRM-DEMO
value data: "d:\app\crm\crm.exe"
OS : Windows 10
0
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.
0
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.
0
Hi,
I am using vb.net 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.
Thanks
0
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.
0
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?
0
Hello,
How to export a image column of sql server to PDF/word  in vb.net.
I am using visual studio 2017 windows version.

Thanks
0
Problems using Powershell and Active Directory?
LVL 8
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="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="Clients">
 <rOWField>
  <BI_CLIENTS>
   <CLIEREFINDIVIDU>xxxx</CLIEREFINDIVIDU>
   <CLIENACEBUSINESS>Wholesale xxxx</CLIENACEBUSINESS>
   <CLIENACECODE>xx</CLIENACECODE>
   <CLIECOUNTRYCODE>DNK</CLIECOUNTRYCODE>
   <CLIEEMAIL>xx</CLIEEMAIL>
   <CLIEZIP />
   <CLIEADDRESS>xx</CLIEADDRESS>
   <CLIECITY>xx</CLIECITY>
   <CLIENAME>xx</CLIENAME>
  </BI_CLIENTS>
  <BI_CLIENTS>
...
</rOWField>
<ROW>
  <CLIEREFINDIVIDU>xx</CLIEREFINDIVIDU>
  <CLIENACEBUSINESS>Wholesale xx</CLIENACEBUSINESS>
  <CLIENACECODE>xx</CLIENACECODE>
  <CLIECOUNTRYCODE>xx</CLIECOUNTRYCODE>
  <CLIEEMAIL>xx</CLIEEMAIL>
  <CLIEZIP />
  <CLIEADDRESS>xx </CLIEADDRESS>
  <CLIECITY>xx</CLIECITY>
  <CLIENAME>xx</CLIENAME>
 </ROW>
</ROWSET>

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.
clients.cs
0
Software: Visual Studio and SQL Server 2005.
On clickonce deployment I get this error: The aplication requires assembly System.IdentityModel Version 3.0.0.0 be installed in the GAC.

Can someone tell me what is required?

Thanks!
0
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
MonthEndFlag.png
0
Hello,
How to delete empty rows in a mail merge Word from vb.net desktop app.
Cheers

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
        doc.Range.Select()
        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
                '.Typebackspace
                .HomeKey(Unit1, missing)
                .MoveDown(Unit1, 1, wdExtend)
                .Delete(wdCharacter, missing)
                .TypeBackspace
            End With
        Loop
    End Sub

Open in new window

0
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
0
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

EX:
ABCDEFGHI should be ABCDEFGH only
ABCDEFGHIJKL should be ABCDEFGH only
ABCDEFGHIJKLMN should be ABCDEFGH only
ABCDEFGHIJKLMN123 should be ABCDEFGH only
ABCDEFGHIJKLMN123456 should be ABCDEFGH only



Thank you
0
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
0
I was successful in creating a database of access through vb.net 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.

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.Create(catstring)
            '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
                .Append("Key", 

Open in new window

0
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">
            <Columns>
                <asp:BoundField DataField="PERSON_ID" ItemStyle-CssClass="hiddencol" HeaderStyle-CssClass="hiddencol" />
                <asp:BoundField DataField="ORG_ID" ItemStyle-CssClass="hiddencol" HeaderStyle-CssClass="hiddencol" />
                <asp:TemplateField>
                <itemtemplate>
                <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")))) %>'/>
            </itemtemplate>
                </asp:TemplateField>
              

Open in new window

0
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 vb.net.  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  www.samplesite.com.  When I bind the hyper link and it is clicked on in the site, it links to

http://intranet2/account/www.sapmlesite.com   I just want it to go to www.samplesite.com

<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Bind("website") %>' Text='<%# Bind("website") %>'></asp:HyperLink>
0
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...




page1
========
<script>
      $(document).ready(function () {
            $("#dialog1").dialog({
                  autoOpen: false
            });
      });
      function Signature() {
             var valueCell = 'test';
              $.get('@Url.Action("AttachDocSignature", "Amendments")', { param1: valueCell }, function (partialView) {
                    $("#dialog1").html(partialView);
        });
       $("#dialog1").dialog('open');
    }
</script>


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,
Pooja
0
Hi,

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
0
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.
0
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?

Tanks.
0
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?
0

Microsoft Visual Studio

700

Solutions

743

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.