Click here to Skip to main content
       

Visual Studio

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page  Show 
GeneralRe: Security featuresmvpRichard MacCutchan17 May '13 - 7:28 
Well I know nothing about python; and you posted this question in the Visual Studio forum. However, and more relevant, there is nothing you can do to a calculator to make it secure, even if we really understood what that is supposed to mean. Go back and talk to your teacher and get a better explanation of what problem you are supposed to be addressing.
Use the best guess

GeneralRe: Security featuresmemberJames R Opdycke II17 May '13 - 7:30 
I will. Thanks anyway!
GeneralRe: Security featuresmemberJames R Opdycke II17 May '13 - 7:11 
This is a visual basic calculator code he also gave as an example:
 
Public Class Form1

Private Sub calculateBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles calculateBtn.Click
Dim number1 As Double
Dim number2 As Double
Dim answer As Double

If input1TextBox.Text = "" OrElse input2TextBox.Text = "" Then
MessageBox.Show("Please Enter a Number")
ElseIf additionRb.Checked = False And subtractRb.Checked = False And multiplyRb.Checked = False And divideRb.Checked = False Then
MessageBox.Show("Please Choose an Operation")
Else
number1 = Double.Parse(input1TextBox.Text)
number2 = Double.Parse(input2TextBox.Text)

If additionRb.Checked = True Then
answer = number1 + number2
answerLbl.Text = answer.ToString()
ElseIf subtractRb.Checked = True Then
answer = number1 - number2
answerLbl.Text = answer.ToString()
ElseIf multiplyRb.Checked = True Then
If number1 = 0 OrElse number2 = 0 Then
answerLbl.Text = "0"
Else
answer = number1 * number2
answerLbl.Text = answer.ToString()
End If
ElseIf divideRb.Checked = True Then
If number1 = 0 Then
answerLbl.Text = "0"
ElseIf number2 = 0 Then
answerLbl.Text = "Cannot Divide by Zero"
Else
answer = number1 / number2
answerLbl.Text = answer.ToString()
End If
End If
End If

End Sub

End Class
AnswerRe: Security featuresmemberJames R Opdycke II16 May '13 - 11:36 
I guess it's anything I can add to my code to make it more secure
QuestionVisual Studio 2012memberJames R Opdycke II7 May '13 - 17:29 
I am just learning how to use the program. When I saved my project and closed out it left me three files.
 
Calculator.Designer.vb
Calculator (resx)
calculator.vb
 
No matter which of these files I open I have no way of opening the project and trying to compile them so I can see if my program works.
 
I would also like to know if there is anyway to turn the GUI interface back on when i reopen a project.
 
Thank you for any help you can give!
AnswerRe: Visual Studio 2012mvpRichard MacCutchan7 May '13 - 21:22 
Start Visual Studio and load the solution or project, not individual files. And press F5 to run the program. See also the Visual Studio help or get a copy of a book on VB.NET which will explain all the different options.
Use the best guess

GeneralRe: Visual Studio 2012memberJames R Opdycke II8 May '13 - 20:55 
It never saved as a project for some reason. I created a new one of the same project and got it to actually work. Thank you!
QuestionView the changes in the database by DATA-SETmemberVb Rnd4 May '13 - 7:07 
HAI

DATABASE : SQLSERVER 2005
VB : 2008
TYPE PROJECT : NETWORK

Use a separate DATASET in the draft and when I update the data or start I update the data also DATASET so you do not need to reopen Aldtasi of the new data because the size of a very large and cause slow in the project How can I find records that have been updated or deleted, or added?
Because the project network
SuggestionRe: View the changes in the database by DATA-SETmvpRichard MacCutchan4 May '13 - 7:37 
Please do not post the same question in multiple forums.
Use the best guess

QuestionCustom Templates [modified]memberJohn Simmons / outlaw programmer25 Apr '13 - 11:52 
I'm trying to create a custom temple, and I have some files in the solution that need to have the project name as their name. I have the following:
 
<ProjectItem ... TargetFileName="$safeprojectname$.dll.config">test.dll.config</ProjectItem>
<ProjectItem ... TargetFileName="$safeprojectname$.xml">test.xml</ProjectItem>
 
But when I create a new project with the template, I get a Visual Studio error saying it can't copy the file because it can't find it.
 
Anybody got any clues for me?
 
EDIT ========================
 
BTW, I also tried using $projectname$ instead of $safeprojectname$, and it doesn't matter where I put either one - I still get the error.
 
Lastly, I tried using "xyz" instead of $projectname$, and that gave me the same error.
 
This is STUPID.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997


modified 26 Apr '13 - 11:12.

AnswerRe: Custom TemplatesmvpRichard MacCutchan25 Apr '13 - 22:42 
I'm not sure what language template or what file the above belongs in, but should you not be using $safeprojectname$ rather than test in the text portions of the above statements?
Use the best guess

GeneralRe: Custom TemplatesmemberJohn Simmons / outlaw programmer25 Apr '13 - 23:25 
I tried that too, but according tot he MSDN site, I'm supposed to use the TargetFileName attribute.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997

GeneralRe: Custom TemplatesmvpRichard MacCutchan25 Apr '13 - 23:30 
Sorry, I'm stumped then, I've not use this type of template.
Use the best guess

AnswerRe: Custom TemplatesmemberJeremy Rice26 Apr '13 - 5:03 
Maybe it's choking on the fact that they're named "test". Is it finding all of the other files ok?
GeneralRe: Custom TemplatesmemberJohn Simmons / outlaw programmer26 Apr '13 - 5:08 
That was a simple replacement because I was too damn lazy to type the actual entire file name.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997

AnswerRe: Custom TemplatesprotectorAspDotNetDev26 Apr '13 - 6:54 
Based on this (probably what you are looking at), you also have to set ReplaceParameters to true:
<ProjectItem ... ReplaceParameters="true" TargetFileName="$safeprojectname$.xml">test.xml</ProjectItem>

GeneralRe: Custom TemplatesprotectorAspDotNetDev26 Apr '13 - 7:24 
Well, nevermind I guess. I just tried this and I get the same error:
Microsoft Visual Studio:
Unable to copy the file 'Go.cs' from the project template to the project.
Cannot find file "C:\Users\AspDotNetDev\Local\Temp\jsdgjlkgjlk.ljksd\Temp\Go.cs".

According to this, it may be a Visual Studio bug. However, if it is, it exists in both 2010 and 2012 (I tried both).

AnswerRe: Custom TemplatesmemberAlan N26 Apr '13 - 7:42 
When I try this the error message is saying it can't find the original file, e.g. test.cs, in the temporary directory used for template expansion.
 
After monitoring the temp folder with a filesystem watcher I can see the correctly renamed file, not the original file. So far so good as the file was supposed to be renamed. The issue is why after having renamed the file, does VS then stupidly look for the original filename.
 
VS appears to be using the project file to decide which files it needs to copy from the temp directory to the final location. The fix is to use replaceable parameters in the project file for any renamed files.
e.g. change
<Compile Include="test.cs" />
to
<Compile Include="$safeprojectname$.cs" />
 
I use the word fix rather than solution as now the modified project file is only good after the parameters have been replaced by template expansion. If you try and open it directly, VS will look for a file named $safeprojectname$.cs.
 
Damn tricky things, these templates!
Alan.
AnswerRe: Custom TemplatesprotectorAspDotNetDev26 Apr '13 - 7:43 
I got it working! The important missing step was to modify the .csproj file itself to account for the new dynamic filename. In my test, this was the only thing I really needed to change:
<Compile Include="$safeprojectname$.cs" />
Just so I have a full example posted here, the contents of my ZIP file are:
Properties
  AssemblyInfo.cs
Go.cs
Testify.csproj
Testify.vstemplate
The contents of AssemblyInfo.cs (GUID changed for security considerations):
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
 
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Testify")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("Testify")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
 
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components.  If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
 
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa")]
 
// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
The contents of Go.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace Testify
{
    class Go
    {
    }
}
The contents of Testify.csproj:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa}</ProjectGuid>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>Testify</RootNamespace>
    <AssemblyName>Testify</AssemblyName>
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
    <FileAlignment>512</FileAlignment>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <OutputPath>bin\Debug\</OutputPath>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdbonly</DebugType>
    <Optimize>true</Optimize>
    <OutputPath>bin\Release\</OutputPath>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Core" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="Microsoft.CSharp" />
    <Reference Include="System.Data" />
    <Reference Include="System.Xml" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="$safeprojectname$.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
  </ItemGroup>
  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
  -->
</Project>
The contents of Testify.vstemplate:
<VSTemplate Version="3.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Project">
  <TemplateData>
    <Name>Testify</Name>
    <Description>Basic C# App</Description>
    <ProjectType>CSharp</ProjectType>
    <ProjectSubType>
    </ProjectSubType>
    <SortOrder>1000</SortOrder>
    <CreateNewFolder>true</CreateNewFolder>
    <DefaultName>Testification</DefaultName>
    <ProvideDefaultName>true</ProvideDefaultName>
    <LocationField>Enabled</LocationField>
    <EnableLocationBrowseButton>true</EnableLocationBrowseButton>
    <Icon>__TemplateIcon.ico</Icon>
  </TemplateData>
  <TemplateContent>
    <Project TargetFileName="Testify.csproj" File="Testify.csproj" ReplaceParameters="true">
      <ProjectItem ReplaceParameters="true" TargetFileName="$safeprojectname$.cs">Go.cs</ProjectItem>
      <Folder Name="Properties" TargetFolderName="Properties">
        <ProjectItem ReplaceParameters="true" TargetFileName="AssemblyInfo.cs">AssemblyInfo.cs</ProjectItem>
      </Folder>
    </Project>
  </TemplateContent>
</VSTemplate>
I put that ZIP file in my "Visual Studio 2012\Templates\ProjectTemplates\Visual C#" folder and was able to successfully create a project from it.

GeneralRe: Custom TemplatesmemberJohn Simmons / outlaw programmer29 Apr '13 - 4:22 
That IS the answer. I tried it this morning, and it worked like a charm. Smile | :)
 
Many thanks, oh great and powerful Oz!
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass." - Dale Earnhardt, 1997

QuestionHow to get the cell that contains a certain text?memberAlek García18 Apr '13 - 16:52 
Hi, I 'm developing (trying actually) a desktop application that works well only if the word "PERIOD" is located in the cell A14(inside an excel file). But instead of that, I'd like to make it work if the word "PERIOD" is found no matter what cell it is in, provided it is inside the column 'A'.
 
That's the problem, I don't know how to search a certain word inside a column and get its cell(the 'row part' actually).
In other words I'm looking for this code: "If a cell inside column A contains "PERIOD", get the number of row".
 
Any ideas?
Thanks in advance.
AnswerRe: How to get the cell that contains a certain text?mvpRichard MacCutchan18 Apr '13 - 23:12 
This has nothing to do with Visual Studio, and since you have not mentioned what programming language you are using, or how you are accessing the Excel file, it is difficult to make a useful suggestion.
Use the best guess

QuestionVisual C++ project physical directory [solved] [modified]memberecony16 Apr '13 - 10:29 
I want to make a directory structure for my project, like:
project1\header
\source
\Lib
\resource
etc..
On my disk, I created the folders. but I don't know how to import the structure to my visual studio virtual groups.
I mean, when I moved .h files to \header folder, visual studio could not found .h files then.
 
Is there a method to let visual studio work with physical directory structures?

modified 19 Apr '13 - 11:48.

AnswerRe: Visual C++ project physical directorymvpRichard MacCutchan16 Apr '13 - 21:24 
Yes it is possible but once you have the files in place you then need to add them to the project in Solution Explorer, from their source locations.
Use the best guess

GeneralRe: Visual C++ project physical directorymemberecony17 Apr '13 - 1:58 
I tried, but the .cpp files can't find .h files.
#include "stdafx.h" for example, even I changed it to:
#include "Header/stdafx.h"
 
IDE gives:
unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?
GeneralRe: Visual C++ project physical directorymvpRichard MacCutchan17 Apr '13 - 2:34 
  1. Do a Clean of your project and delete all the Debug and Release folders.
  2. Make sure that you have added all the files into the project correctly.
  3. Check that all #include statements have the correct path prefix where necessary.
  4. Rebuild the project and correct any errors.
  5. Repeat as necessary.
Use the best guess

GeneralRe: Visual C++ project physical directorymemberecony18 Apr '13 - 10:26 
I changed the project directory structure like the following:
 
project1\Header\StdAfx.h
project1\Source\StdAfx.cpp
project1\project1.vcproj; project1.sln
 
Now I got error message:
fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?
 
In StdAfx.cpp, only one statement:
#include "..\Header\stdafx.h"
 
Could you give me some tip?
GeneralRe: Visual C++ project physical directorymvpDave Kreskowiak18 Apr '13 - 10:51 
Hre's a tip. Try pasting that error message into Google.
 
It's very easy to fix.

GeneralRe: Visual C++ project physical directorymemberecony18 Apr '13 - 15:14 
Tried,Can't find solution
GeneralRe: Visual C++ project physical directorymvpDave Kreskowiak18 Apr '13 - 15:37 
bullsh*t. You're going to do some work for this one. Do what I told you and the very first link will solve it.

GeneralRe: Visual C++ project physical directorymvpRichard MacCutchan18 Apr '13 - 22:45 
I already told you what to do in my previous response. However, given the fact that you do not really seem to understand how this works, I would suggest you forget this idea and stick with the standard project structure as created by Visual Studio.
Use the best guess

GeneralRe: Visual C++ project physical directorymemberecony19 Apr '13 - 4:37 
I understand your previous post. and I created a test project, sure, it works.
But, the project I am working with, it seems remove old, add new location, clean, IDE still give error messages.
This is a WinCE template project, supplied by one company, will ask them how to solve it.
 
Thank you for your help
GeneralRe: Visual C++ project physical directorymvpRichard MacCutchan19 Apr '13 - 5:37 
The error message indicates that the project has not been cleaned properly, as Visual Studio thinks that there should be a precompiled header somewhere. Clean and rebuild should fix this. Since this project is not your own it would make more sense to leave it as is.
Use the best guess

Questionwhy cannot find code map in vistual studio2012 update2?memberhack00414 Apr '13 - 21:30 
i was update up update2,but right click still no see code map,,why??thanks for reply
AnswerRe: why cannot find code map in vistual studio2012 update2?professionalRichard Deeming15 Apr '13 - 1:49 
Which edition of Visual Studio? You'll need Ultimate to create code maps. Either Premium or Professional will let you open existing maps, make limited edits, and navigate code.
http://msdn.microsoft.com/en-gb/library/vstudio/jj739835.aspx[^]



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: why cannot find code map in vistual studio2012 update2?memberhack00415 Apr '13 - 2:45 
yes,that's Ultimate version,but i not see mapcode?why?need setup it?
GeneralRe: why cannot find code map in vistual studio2012 update2?mvpDave Kreskowiak15 Apr '13 - 3:56 
If you have Ultimate, you can right-click a solution, project, or code file in the Solution Explorer and pick "Show on Code Map".
 
If you don't see this option, you don't have Ultimate.

GeneralRe: why cannot find code map in vistual studio2012 update2?memberhack00415 Apr '13 - 4:12 
now it's working,but why right click in code editor no show?,,however thank you!
GeneralRe: why cannot find code map in vistual studio2012 update2?mvpDave Kreskowiak15 Apr '13 - 6:21 
It depends on exactly what you right-click on what's going to show up in the menu and how it's worded.

Question[VC++ & XAML] keydown event bug on the touch keyboard for metrop app programmingprofessionalMember 997974310 Apr '13 - 20:58 
Hi,
I am a beginner for Metro app development and trying to use the keydown event but not the keyup event with a text box element on the XAML. I have created two key event functions (up and down) from the text box, which are the below. The problem is the keydown function works only when the key is up but not down. If I hold the key press down, the event does not come out until the key up, which is the same as the keyup function.
 
I am working to get keyboard input from the touch softkeyboard. For example, after invoking the touch keyboard with the text box element, I like to play a unique sound only when a key (e.g., 'Q' or 'K') is pressed.
 
Anyone knows how to fix this problem? I also appreciate that you can help me know the alternative way with an example source code. Thank you a lot in advance.
 

MainPage::OnKeyUp(Platform::Object^ sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs^ e)
{
if((int)e->Key == 112) // F1 key
{
errorText->Text = "F1 Key up";
}
 
}
 
MainPage::OnKeyDown(Platform::Object^ sender, Windows::UI::Xaml::Input::KeyRoutedEventArgs^ e)
{
if((int)e->Key == 112) // F1 key
{
errorText->Text = "F1 Key down";
}
}

I just found that only space key, backspace and enter key are working for keydown but all other keys are sending the key down event when the key is released on the touch keyboard. So my question must be rephrased to how to make all other keys send the keydown event on the Keydown api? or the other apis?

Thank you.
SuggestionRe: [VC++ & XAML] keydown event bug on the touch keyboard for metrop app programmingmvpRichard MacCutchan10 Apr '13 - 21:56 
Please do not post the same question in multiple forums. This is also not a Visual Studio issue.
Use the best guess

QuestionVB - Adding to List(of String) from datagridview column/cell value [modified]memberPrissySC6 Apr '13 - 12:20 
(SOLVED) I have played with this, but I am missing the obvious. Can I borrow your brains again? (I dislike working alone.)
 
I make a selection in the datagridview. This selection is now processed in the make list handle. I bold the first column's text for identity on the datagridview. I want to keep the value from the cell in a list. I get out of range and null exceptions.
 
At this point, I do not have the cleanest code as I am working on operational aspects of the grid. So, below the instruction to bold the selected, I am counting the bolded (which works fine) for a count value on the form to be displayed, but I cannot add the "job number" to my list. And before you ask, yes the job number is a string. I checked that first!
 
Original declaration is ...
 
dim selectedJobNo as list(of string)
 
 Private Sub MakeListToolStrip_Click_1(sender As Object, e As EventArgs) Handles MakeListToolStrip.Click
 
        Dim f As Font = New Font(JobsDataGridView.Font, FontStyle.Bold)
 
        For selectrow = 0 To JobsDataGridView.SelectedRows.Count - 1
            JobsDataGridView.SelectedRows(selectrow).Cells(0).Style.Font = f
 
        Next
 
        Dim i As Integer = 0
        Dim count As Integer = 0
        selectedJobNo = New List(Of String)
 
        For i = 0 To JobsDataGridView.Rows.Count - 1
 
            If JobsDataGridView.Rows(i).Cells(0).InheritedStyle.Font.Bold Then
                count = count + 1
                selectedJobNo.Add(JobsDataGridView.SelectedRows(i).Cells(0).Value.ToString)
                MsgBox(selectedJobNo.Count)
            End If
 
        Next
        JobSelectedToolStrip.Text = count
 
        'remove highlight selection and deselect any row highlight
        Me.JobsDataGridView.SelectionMode = DataGridViewSelectionMode.CellSelect
    End Sub
 
Solution:
 

I am leaving this post in case someone tries a similar method. However, I switched to a collection! I don't know why I didn't think of this. I am so very accustomed to just using a list.
 
Here is what I did ...
1. When item selected in the DGV. I bolded the index/reference cell only. I add to the collection.
2. When removing an item from the custom selected list, I un-bold the index/reference cell. I remove from the collection.
3. When they switch between sorts, I run through the collection to bold the index/reference cells (because the DGV gets a new datasource selected based on the predefined sorts open/closed/all).
4. On request to print, I run through and add to an unbound datasource which I assign as the base for the dataset that prints the report and exports to excel.
 
Don't forget to check if the index/reference in the collection exists.
 
You might wonder why I just don't track the DGVrows? Well, the way that it works, user can select and deselect as many times on as many different sorts as the user would want (which is quite often). I did not want to keep moving these rows in and out and sacrifice any "time". I kept it simple and did not record any selections until the time at which the user decides that they actually want the selection.
 
Hope that made sense, LOL.

modified 7 Apr '13 - 17:02.

QuestionVS2010 IDE Freezing on Edit Items [modified]memberZombie Code Monkey26 Mar '13 - 7:45 
I have two VS2010 WinForms applications that are very similar to each other. Both have a MenuStrip and a StatusStrip. Whenever I attempt to edit the items on either control in either application VS freezes, and as far as I know, never returns. I've waited up to 10 minutes with nothing happening. I've had one other developer test one of the solutions on his PC and they didn't have this problem. As a test I opened a different WinForms app that also contained a MenuStrip and StatusStrip in VS2010 and I have no problems editing the items for that application.
 
It doesn't seem to matter how I try to edit the items, clicking the Edit Items link in the popup, or the Collection button in the properties window, or the Edit Items link at the bottom of the properties window, they all cause the IDE to freeze.
 
In an attempt to resolve this I've deleted both the MenuStrip and StatusStrip and replaced them one at a time, no change. I've copied all of the controls from one application to a brand new application, including any custom control code, I can edit the items in the new application with no problems. Creating a new application adding new controls also allows me to edit the control items. I've compared the designer code between a non-working and working app for the StatusStrip and nothing seems odd to me.
 
We're all running Windows 7 Professional 64-bit, there's really no reason this should be freezing the IDE the way it is, and doing it just for me. I've spent some time on the Internet looking for anyone else reporting similar problems and didn't really find anythihng. Has anybody seen this before and do you have a good solution? I'd really prefer not to copy/paste the code into a brand new application. Although, that may be my only choice.
 

[Edit]
I found out what the issue was and in case anyone else runs into this here's the explanation. This is caused by a circular reference. Why this causes controls to hang when attempting to edit their items, I have no clue. To put it simply, we have two applications compiled as dlls (A.dll, B.dll), both are launched by the same menu application. Both of the applications reference each other, e.g. A.dll references B.dll and B.dll references A.dll. This is done so each application can load the other and pass certain data to the other application to perform an auto-lookup.
 
I discovered this by creating a completely new solution for A.dll and copying all the code files from the original solution into the new solution. Once I got the solution to compile I started adding references one at a time and checking to see if the edit items would work. Everything was fine until I added a reference to B.dll to the new A.dll solution. As a test I switched back to the original solution for A.dll and removed the reference to B.dll. After a recompile the edit items collection editor worked as expected.
 
I also performed this same test with VS2012 and it freezes the IDE as well. This does not appear to be a problem with VS2005, VS2008. Also, I do not know if this is an issue with just 64-bit or it if happens on 32-bit as well.
Comments from work:
  • "Why can't you just do it like everybody else?"
  • "Well, we haven't had any complaints yet."
  • "I just want to get it into production."
  • "It only matters if it’s important to someone who matters."



modified 27 Mar '13 - 11:51.

QuestionAppWizard and Visual Source SafememberAnorexic Tribble22 Mar '13 - 4:34 
I am writing a custom AppWizard. I can figure how to add files from the templates and change the UI. I now want to include files from my source safe repository. I am using VS2008 and VSS 2005.
 
Two question really
 
1) How can I tell if the user ticked the "Add to Source Control" checkbox on the main AppWizard dialog. I assume that it a symbol, but what is it called?
 
2) How do I add an existing item from the source safe database to the project being created by AppWizard? The SourceControl object has methods for checking out items and the ProjectItems object has methods to add a file from a folder, which are then added as new items in the Source Control database. Obviously I know how to do this from Visual Studio itself. I'm just trying to automate it from AppWizard,
QuestionHow can I read a link from databse in vb.netmembermnxford18 Mar '13 - 3:48 
I made my software in vb.net and connected it with MySQLDatabse and using phpmyadmin I have create a table update and a column version....
 
In the version column I have inserted the link of version.txt Now I want that my update library which is updateVB will get the link of version.txt from the databse from that table....
 
The UpdateVB component strings are:
 
Updatevb1.checkforupdate("Text file where your version is stated (URL)", 
                         "Current Version", 
                         "URL of executable updater (SFX Archive), 
                         "Username for FTP", "Password for FTP", 
                          showUI As Boolean)
 
I want to get every of these informations like: Text file version URL, current version, URL of executable update etc...
 
I want all the informations to read from the database....
 
I have tried this in my update.vb:
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        conn = New MySqlConnection(ServerString)
        Try
            conn.Open()
            Dim sqlquery As String = "SELECT FROM updater"
            Dim data As MySqlDataReader
            Dim adapter As New MySqlDataAdapter
            Dim command As New MySqlCommand
            command.CommandText = sqlquery
            command.Connection = conn
            adapter.SelectCommand = command
            data = command.ExecuteReader
            While data.Read()
                If data.HasRows() Then
                    Dim vlink As String = data(1).ToString
                    Dim dlink As String = data(2).ToString
                    Dim ftpu As String = data(3).ToString
                    Dim ftpp As String = data(4).ToString
                End If
            End While
            UpdateVB1.checkforupdate("vlink", "0.0.9", "dlink", "ftpu", "ftpp", showUI:=True)
            data.Close()
            conn.Close()
        Catch ex As Exception
        End Try
    End Sub
I used mysqlreader here to get the links...but it doesn't work....
GeneralRe: How can I read a link from databse in vb.netmvpRichard MacCutchan18 Mar '13 - 6:02 
Please:
  1. Post your query in the correct forum.
  2. Format your code properly and put it inside <pre> tags for readability.
Use the best guess

GeneralRe: How can I read a link from databse in vb.netmembermnxford18 Mar '13 - 10:38 
The no.2 connection is done...
But I am not able to do the correction no.1 because I think it is the right section...if not then please move the topic to the right section.....
GeneralRe: How can I read a link from databse in vb.netmvpRichard MacCutchan18 Mar '13 - 23:10 
mnxford wrote:
I think it is the right section
Your question is about using a Database in VB.NET, both of which have their own forums. This forum is for questions and problems with Visual Studio.
Use the best guess

GeneralRe: How can I read a link from databse in vb.netmembermnxford19 Mar '13 - 8:27 
m0ve this topic to the right section plzzz......
GeneralRe: How can I read a link from databse in vb.netmvpRichard MacCutchan19 Mar '13 - 8:30 
Sorry that's not my role in life. You can edit the original to say it's been moved, and open a new question in the right place; CodeProject is very much a do-it-yourself site.
Use the best guess

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   


Advertise | Privacy | Mobile
Web04 | 2.6.130523.1 | Last Updated 22 May 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid