Visual Basic.NET

92K

Solutions

24K

Contributors

Visual Basic .NET (VB.NET) is an object-oriented programming language implemented on the .NET framework, but also supported on other platforms such as Mono and Silverlight. Microsoft launched VB.NET as the successor to the Visual Basic language. Though it is similar in syntax to  Visual Basic pre-2002, it is not the same technology,

Share tech news, updates, or what's on your mind.

Sign up to Post

Hello experts

Its been a while since ive played in visual studio as ive been more a powershell person and looking for a bit of guidance. I was mainly writing this as a vb app instead of powershell for performance reasons in terms of faster launching but you might indicate this is incorrect. Amongst other things the app I was writing needs to work with the windows 7/10 credential manager to check if a credential already exists or not and if it doesn't preadd the username and target name to minimise confusion amongst endusers who are typing the incorrect credential and causing problems. So basically the command line I need to encapsulate into vb is

Cmdkey /list:ourtarget.provider.local

which will either return the credential details or say * NONE*. In powershell its relatively simple to pipe it with | foreach-object and check if the credential is there and im just wanting advice on how to do similar in VB or is there a better inbuilt way for vb to work with the windows credential manager ? I'll be adding the credential if it doesn't exist using info pulled from our AD which ive already got sorted in the code just a bit stuck on executing the external cmdkey program from within vb and parsing it
0
New feature and membership benefit!
LVL 9
New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Hi Experts,

I am trying to prevent textbox TextChanged event when any button is clicked. So I wrote the following code. When I run the program It is saying there are errors in the progeam. But it is now showing any error. If I take away the hidden field code then it runs fine.

Please help.

Thanks in advance.

<asp:TextBox ID="txtSelectedDate" runat="server" CssClass="MediumTextBox" AutoPostBack ="true" ></asp:TextBox>
<asp:Button ID="cmdPrevious" runat="server" Text="< Prev" OnClientClick="setButtonClicked();" onclick="cmdPrevious_Click" />
 <asp:Button ID="cmdNext" runat="server" Text="Next >"  OnClientClick="setButtonClicked();" onclick="cmdNext_Click"/>
 <asp:HiddenField ID="HiddenField1" runat="server" Value="false" />


    <script>
         function setButtonClicked() {
             document.getElementById('<%= HiddenField1.ClientID %>').value = 'true';
         }
     </script>


ASP code
-------------

  If HiddenField1.Value = "false" Then

 else
      HiddenField1.Value = "false"
end if
0
I am trying to resize the Form in a run time. Depending of the user choice it could be either original size or its height should be increase. However Property "Size" is not available, so MyForm.Size = New Size(100, 200). How can I resize the form? Please help.
0
Hi experts.
I have a form.  The form has two flow layout panels created at run time.
The flowlayout panels contain custom controls.
I want the user to be able to select a custom control in a flow layout panel.  
When the item is selected, it should change the background of the custom control to red.  
When the user selects a different control, it sets the first custom control to blue and sets the new one to red.  
Some controls are added from a DB read while others are created from the user via drag and drop.
sample magnets.  Blue from DB load, yellow from drag and drop
If the controls are all from a DB read, code works.  However items created from drag and drop do not change the highlighting.

Code as follows:

Private _StoredMagnet As LaborMagnet

 Private Sub MyMouseClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs)
        '  Dim source As Control = CType(sender, Control)
        Dim MySelectedControl As Control = DirectCast(sender, Control)
        If TypeOf MySelectedControl Is LaborMagnet Then

            'IF a magnet is already clicked it is stored as the selected magnet
            If Not _StoredMagnet Is Nothing Then
                'If a magnet is stored, change that magnet to blue.
                DirectCast(_StoredMagnet, LaborMagnet).BackColor = Color.SteelBlue
            End If

            'Set the currently clicked magnet to the selected magnet
            _StoredMagnet = DirectCast(MySelectedControl, LaborMagnet)
            'Change the 

Open in new window

0
I want to create a timed screensaver vb.net
0
I have defined a report in ReportViewer and it runs fine. I'm developing in VB.Net using VS 2013.

Now I'd like to narrow the rows selected to a given month (my rows all have a date field). So I tried to define a filter on the group I'm using to drive the report, but this fails, because my expresiion for the filter is for example:
 Set expression for value:
 1 =DateSerial(Year(Now), Month(Now), 1) -1

This sets the date to the last day of the previous month in VB.Net, but ReportViewer tells me that: >>operator '-'  is not defined for types 'Date' and 'Integer'<<  and refuses to run !

In the same vein, I have an even more complicated expression:

IIf(Month(Now)>1,DateSerial(Year(Now), Month(Now)-1, 1),DateSerial(Year(Now)-1, 12, 1))

which sets the date to the first day of the previous month, taking in account the special case of the current month being January, therefore the previous month being december of the previous year. Needless to say, that expression is also invalid as a filter according to ReportViewer.

What am I doing which is tripping up RV ? How should my expressions be ?

Thanks for help
Bernard
0
Hi all,
is any way to send a file who is located in external iis folder!

Dim stream As FileStream = File.OpenRead("e:\test.docx")

Open in new window



that is an example works in my local drive,
what is the proper sintax for a iis folder location!
regards
0
Is it possible?
0
I am in need for a method to convert from a richtextbox to html so I can run a RDLC report. It hs to be in the following format:

<div><font face="Engravers MT" size=4>THE [OrgName] RECOGNIZES [FirstName] [LastName] FOR [HisHer] OUTSTANDING SERVICE TO THE [OrgName]. FROM THE PERIOD [StartDate] TO [PrintDate] WHILE ASSISGNED AS A [Title], [OrgName], [Title] [LastName] CONTRIBUTED COUTLESS HOURS OF VOLUNTEER SERVICE TO THE TOWN OF [OrgCity]. [Title] [LastName]'S DEDICATION AND SERVICE REFLECTS GREAT CREDIT UPON [HimHer]SELF, LAW ENFORCEMENT EXPLORING, [OrgName] AND THE TOWN OF [OrgCity]. </font></div>

<div><font face="Engravers MT" size=4>Given on this day [PrintDate]</font></div>,

OR does anyone know a better way to take a Richtextbox stored in the DB and print it to a RDLC. We are a nonprofit an paying for components is not a option

Thanks
0
I have a list of business name and their address including zip code in different columns which is quite long and can't do manual search on google. Now I want to pull information about their website, email and phone on google. I am just curious to know if its can be done.

Can we do a similar search thru Facebook?

If So, I am looking for both solution

I am new to VB / Macros. So, looking for detailed instructions help with code as well as how to apply it.

Thank you!
Gaurav
0
[Webinar] How Hackers Steal Your Credentials
LVL 9
[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them.

Hello,
Can anyone recommend the best course for mobile development.
I have few vb.net desktop projects to be migrated to mobile.
Any suggestions on this.

Regards
0
In my vb.net winforms .NET application I need to merge two different datatables that each have a field they match on. One is the parent, one is the child. The child has more rows. In Master Table the field to match is "Rec_ID". In the child table the field that matches Rec_ID is "Order ID". They tables have already been populated with data at the time to make the match. Merge does not work as the schemas of the tables are quite different. Relations do not work with tables populated after the fact. I am going nuts here. Thank you.
0
I have a screen where the user can search on an ID and if there are multiple records(and there usually are) I have a < > symbols to go to the next or to the previous record. This fills the fields with the values and does its thing. My issue is that the screen will flicker everytime I go to the next record. I put an UpdatePanel around it and this didnt fix it and Im wondering if there is anything I can do to make this just go away!  My code is below and Im curious if there is anything I can do with the UpdatePanel to make it stop flickering. Any other suggestions are welcome too.

Markup
            <div style="width:350px">
                <asp:UpdatePanel ID="upScroll" runat="server" UpdateMode="Conditional" >
                    <ContentTemplate>
                        <table style="width: 350px">
                            <tr id="trScroll" runat="server" align="center" style="width:350px;" >
                        <%--<td style="width:0px;" >

                        </td>--%>
                        <td id="tdRecordScroll" runat="server" align="center" style="border-collapse:collapse;"> <%-- vertical-align:middle; --%>                     
                            <asp:ImageButton ID="previous" runat="server" ImageUrl="~/images/previous_blue.png" OnClick="previous_Click" visible="false" ImageAlign="Middle"/>
                            <asp:ImageButton ID="next" runat="server" ImageUrl="~/images/next_blue.png" OnClick="next_Click" visible="false" 

Open in new window

0
i have developed application using vb.net. which have sql server 2008 database and also includes crystal reports. and i want to create .exe of project. For distribution. I am trying to do this with visual studio 2010.. Using traditional method..by selecting Setup And Deployment Projects..but after clicking on primary output it give message like.."" The following files may have dependencies that can not be determinited automatically. Please confirm that all dependencies have been added to the project c:\windows\system32 \macromed\flash\flash.ocx..""  Please help me to solve this..
0
Hello friends I have a problem with DIGITALPERSONA ONE TOUCH READER BIOMETRIC ,I cant take and save image of finger to jpg,here is a example of my code.....

Private Sub DPFPEnrollmentControl1_OnComplete(ByVal pSerialNumber As String, ByVal lEnrolledFinger As Long)
Dim oPicture As IPictureDisp
Set oPicture = DPFPEnrollmentControl1.EnrolledFingersMask
Picture1.Picture = DPFPVerificationControl1
End Sub


really I dont know how to resoved it if anyone can help me would be a GREAT help......thank you for you time.
0
So, a client would like to be able to have their employees receive a message if they haven't entered in time within the last 7 days. Specifically Monday - Monday at 12:00PM. If the employees have not entered in time by noon, they should be locked down and only allowed to enter time for dates that fall within the last 7 days. The code is written in VB.NET and utilizes SQL and Stored Procedures heavily. I was hoping to get some ideas in regards to possible ways to go about this.
0
I am trying to find the best support for this process. I want to be able to make a call to an excel grid in any version of  Excel (2003-2016) so that I can export the setting.

What do I need in order to do this?

Thanks in advance.
0
I have just started to work with WPF using VB.net and have had trouble getting the DataGrid to work with the Access Database (Jet) that holds my data.  I learn best through examples and I would be grateful if someone can give me sample code (both XAML and VB) to solve the following situation.

I have a DataGrid as follows:
            <DataGrid Name="dgPayment" Margin="10,15,10,10" Grid.Column="0" AutoGenerateColumns="False"
                      ItemsSource="{Binding}"
                      RowEditEnding="dgPayment_RowEditEnding"
                      CellEditEnding="dgPayment_CellEditEnding"
                      SelectionChanged="dgPayment_SelectionChanged"
                      CommandManager.PreviewExecuted="dgPayment_PreviewCommand"
                      IsReadOnly="False" CanUserAddRows="True" CanUserDeleteRows="True" >
                <DataGrid.Columns>
                    <DataGridTextColumn Header="Seq" Binding="{Binding Path=CL_Seq}" />
                    <DataGridTextColumn Header="Name" Binding="{Binding Path=CL_Name}" Width="200" />
                    <DataGridTextColumn Header="Hdr1" Binding="{Binding Path=CL_Hdr1}" />
                    <DataGridTextColumn Header="Hdr2" Binding="{Binding Path=CL_Hdr2}" />
                    <DataGridTextColumn Header="Hdr3" Binding="{Binding Path=CL_Hdr3}" />
                </DataGrid.Columns>
            </DataGrid>

I have code behind as follows:
            Using conn = CashConnection
            …
0
In oracle have a stored procedure return a clob and in vb.net assign the clob to a devexpress richtextbox's rtftext property
0
New benefit for Premium Members - Upgrade now!
LVL 9
New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Hello all. I have an ASP.NET web forms application that has been working fine until a recent change from cookies to session variables (don't think that has anything to do with it but ...) and an upgrade of the Telerik controls.
The same code behind, in two separate ASPX pages (print and reprint), behave differently. They both use this format:

1 Dim PrintCmd as String = "PrintForm.aspx?var1=value&var2=value..."
2 PrintCmd =  "<script language=javascript> {window.open('" & PrintCmd & "', '_blank');}</script>"
3 WriteNlog.Info(PrintCmd)
4 Response.Write(PrintCmd)
5 Response.Write(PrintCmd.Replace("Some Text","Other Text")
6 CallNlog.Info("Returned from print")

The page being called is a simple ASPX that copies the query values to labels and then the body performs window.print() then window.close(). It makes an NLog entry at preload and load, when it works.

Page1.aspx executes 1,2,3 and 6. Logging in the PrintForm.aspx does not occur, no error is reported, as if 4 and 5 are comments.
Page2.aspx executes 1 through 6 without fail.

Both origination forms use the same site master with Telerik controls (RadScriptManager, RadMenu, RadAjaxLoadingPanel and RadAjaxManager).
The print page is pure ASP webform.

Alternately I have tried:
4 ClientScript.RegisterStartupScript(Me.GetType(), "receipt1", PrintCmd, True)
5 ClientScript.RegisterStartupScript(Me.GetType(), "receipt2", PrintCmd.Replace("Some Text","Other Text"), True)

Again, page2 works flawlessly and …
0
I want to store HTML code in database.
is it possible? If yes then how?
0
Everything was going well... playing around with Visual Studio 2017 for the first time...

Had a weird problem (#1, but not really what the question is about where even though I set the Assembly Name and Root Namespace names, ApplicationName was still returning "WindowsApp1" when referenced... so I thought maybe it's building using that temp name when run from VS IDE.  So I compiled it into an app and deployed it.  Same result...

So I try re-opening the project - I can't open forms!  I can a new form, but when I try to open the main form, the only "main" reference I have is main.vb.  And when I open that, I don't have any code either!  I have one other form in the app and I can't open that either (but the code is visible).

I'd really like to continue this project but I need to see the forms!  HELP PLEASE!?!

(Classic Windows Forms app).
0
Hi all, I need to start an aspx page with a modal window if a codebehind query condition is true,
how to achive that dear experts!!!
0
Hello,
How can i highlight the cell border when clicked on it.

I am using vb.net 2015 desktop.

Cheers
0
I'm using Visual Basic in a Windows forms .net framework 4.0 application.

On load of my window I set a variable to the default value of this:

Dim TestVariable1 = "A"

I have a button called Button1 on my page.

I want to have the button toggle the value of my variable between 3 different values.

So if I click the button once then my variable is set to the following:

  TestVariable1 = "B"

If I click on the button a second time then my variable is set to the following:

  TestVariable1 = "C"


Then if I click the button a 3rd  time then my variable is set back to the following and the sequence starts over again:

  TestVariable1 = "A"


So then to summarize, on each button click , the button will rotate the value of my variable between "A", "B", "C"

Any ideas of how I would set up either a Visual Basic case or if else statement for this?
0

Visual Basic.NET

92K

Solutions

24K

Contributors

Visual Basic .NET (VB.NET) is an object-oriented programming language implemented on the .NET framework, but also supported on other platforms such as Mono and Silverlight. Microsoft launched VB.NET as the successor to the Visual Basic language. Though it is similar in syntax to  Visual Basic pre-2002, it is not the same technology,