Mark A Function As Deprecated?
Aug 5, 2009Is there an ability in VB.NET to deprecate code?I know that in C# there are 'attributes', and tags in java; is there anything similar in VB.NET, other than leaving a 'todo:...?
View 3 RepliesIs there an ability in VB.NET to deprecate code?I know that in C# there are 'attributes', and tags in java; is there anything similar in VB.NET, other than leaving a 'todo:...?
View 3 RepliesIn .NET you can mark certain methods as obsolete so that developers are alerted when they attempt to use the deprecated method.
<Obsolete("Do not call this method.")> Private Sub FormerMethod()
The thing is you can only do this within classes you control. What do you do when you want your developers to avoid using certain methods on classes provided natively in .NET or by a vendor?
For example, what if you want your developer to prefer some custom extension method on DataTable rather than Select. I'd hate to have to define a custom version of the DataTable class if only to deprecate Select. That would leave us having to police whether or not the custom table was being used.
Here is a VB.NET Console module I'm testing to understand how Multi-Threading/Threads work.
Imports System
Imports System.Threading
Module Module1
Public Class SimpleThread
Public Sub SimpleMethod()
[Code]...
I have created a few WebRequest extension methods that support cancelling. Is it possible to mark related .net framework methods as Obsolete. That will allow other developers to get warning and encourage them to use a new extension methods.
View 3 RepliesUsing VS.NET 7.1, VB.NET 2003 , SQL SERVER 2005 EXPRESS, ASP.NET 1.1I'm getting a Server Error.I'm having a problem with deprecated large object as OUTPUT parameters,i am putting the data into a textbox, I'm using VarChar(max) in sql, there is novarchar(max) in vb.net 2003, NText and Text are now deprecated so I am limitedto varchar and 8,000 characters(that works).How do I get around this, is there anyway to change the enumeration in vs.net 7.1, vb.net 2003...Invalid parameter 5 ('@Body'): Data type 0x63 is a deprecated large object, or LOB, but is marked as output parameter. Deprecated types are not supported as output parameters. Use current large object types instead. [code]
View 1 RepliesI am new to vb this is the code i am working on[code]...
I changed XslTranform to XslCompiledTranform - is this right thing to do?
But i am still getting few other errors as xmlCtl.Document is obselete and value of xmlCtl.Transform cannot be converted to Transformer. I am using .Net 4.0 .
I'm coverted legacy code of a .NET Framework 1.0 web application. It contains the method StringType.FromObject ..... is there a replacement for this? labelAlerts.Text = StringType.FromObject(GetArticles("DispAreaAlerts"));
View 1 RepliesI have a POCO object and I want to mark a property as a key (see TestClass below).I'm getting the following error. 'Key' cannot be used as an attribute because it is not a class. C:UserszzzDocumentsVisual Studio 2010ProjectszzzzzzBOTestClass.vb
[Code]...
I want to use a value that is pulled from the SQL within the if statement. Ideally i want to do the equivalent of <% If DataBinder.Eval(Container, "DataItem.BookID") == 1 Then%> Is there a way to do this with the correct syntax?
View 2 RepliesThe numbers that get displayed are beyond the 2000. How do I write the code to only display numbers up to 2000.
Sub Main()
Dim iNum1 As Integer
Dim iNum2 As Integer
[code]......
I have a program that takes data from text boxes and exports them to a text file (all of this works). the problem I'm having is how do i mark the file for deletion? I couldn't find a tutorial on it.[code]
View 1 RepliesPossible Duplicate: Place watermark image on other images (C#, ASP.Net) how to add water mark to a photo during uploading in asp.net ???
View 1 RepliesI am trying to create an HTML email with an attached image using asp.net VB.
The trouble I am having is that the image is stored as binary code in a table rather than on the server.
I have the following code:
Dim myHeader As New LinkedResource(Server.MapPath("/Handler.aspx?id=237"), "image/jpeg")
I know it's the question mark in the path that's causing the problem. Does anyone know a way around this??
I have a DataTable which I want to check if values in three of the columns are unique. If not, the last column should be filled with the line number of the first appearance of the value-combination.
[Code]...
I solved this by iterating the DataTable with two nested for loops and comparing the values. While this works fine for a small amount of data, it gets pretty slow when the DataTable contains a lot of rows.My question is: What is the best/fastest solution for this problem, regarding that the amount of data can vary between let's say 100 and 20000 rows? Is there a way to do this using LINQ? (I'm not too familiar with it, but I want to learn!)
In my application I have bound a datagridview to a SQL2005 bindingsource.I really had to change a database field (more length allowed) and now de DGV displays red exclamation marks and states: 'Colomn 'password' exceeds the MaxLength limit'. (the 'password'-colomn isn't even displayed, but that's a sidenote).I tried different things but can't get rid of the exclamation marks. how I can manage this. I really don't want to create a new DGV, because there a lot of code and stuff involved.
View 2 RepliesPrivate Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim Response As Integer
' Displays a message box with the yes and no options.
Response = MsgBox("Do you really want to exit?", Buttons:=vbYesNo)
[Code] .....
How do I place that blue question mark symbol next to "Do you really want to exit?"
I'm trying to search a picture from a color or a color close to the original color and then mark it in the picture if it is in the picture. How can I do this?
View 13 RepliesLets say I have opened image on the screen. I want to find coordinates of little object on that picture. I know pixel pattern of that object.
[Code]...
What would be the easiest way to have a NumericUpDown control showing a double quote " after the value? It's to represent a distance in inches.
From MS Word:
I am encountering a problem. I want to write a string into a text file, and string is:
[Code]....
I m making a chart using MS Charts. Now the chart has mark points from where i want to get the coordinates if user clicks on the mark points.
I want interactivity in the chart such that on clicking on the mark points i can retrive the cordinates (x-axis and y-axis) for the mark points.
For example for the graph:-
on clicking on the orange dots or blue dots i want to get the cordinates for that point,
for example the first blue point is (10/11/2011, 49)
How do I prevent the page from reloading when ever I click on a checkbox?This can be cumbersome when I have hundreds of checkboxes.Below is my code:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
[code]....
I have a gridview as shown below. When the EmpType is contract the EmpID must be masked as "XXX"; for regular employees, actual EmpID should be shown. Also, when it is masked, I need to add a button control in the EmpID column.I need to do it using mark-up; not using code behind. How can we write the conditional logic for Gridview's ItemTemplate for this logic?Note: .Net 4.0
<asp:GridView ID="Gridview1" runat="server" AutoGenerateColumns="False">
<Columns>
<asp:BoundField HeaderText="AssociateID" DataField="AssociateID" />
[code].....
What would be the easiest way to have a NumericUpDown control showing a double quote " after the value? It's to represent a distance in inches.From MS Word: InchesNUD.jpg
View 2 RepliesHow can I display service mark symbol SM in coding.I tried ChrW(8480) but it does work will other browser except IE 8.
View 3 RepliesUpdate: (Please vote to close) This question is unresolved, and is likely a list view bug.It can be replicated by using the example code from the MSDN link below, and adding this code after the list view initialization code:
myListView.View = View.Details;
myListView.Columns.Add("Column1");
myListView.Groups.Add("group", "group");
[code].....
imagine following situation 2 forms, one form with some buttons and another form with a RichTextBox on it, if i click on the buttons the text in the RTB changes. Now i want to mark some words in the RTB with the mouse. The form with the buttons is the active form, if i click in the RTB and try to mark something, the form gets focus and comes to the front but if i move the mouse nothing happens. I have to perform a second click at first to mark something.I already tried a lot of things like setting focus to the form if the MouseButtonDown event fires, but all of that doesn't work. The only possibility that works if i set focus to the form when ever the mouse moves over the form, but this is annoying, cause everytime i move the mouse on the form the form pops to the front.How can i manage to mark the text with one simple click? Applications like OpenOffice or Notepad++ are able to do this as well.
View 1 RepliesI am using Visual Studio/VB.NET 2008 and have a NumericUpDown control on Windows Form. I am forcing user to use Up/Down buttons to change the value, preventing direct entry of a value. This is accomplished be setting the ReadOnly property to True - so far so good. Is there a way to prevent the Insertion Mark from displaying? The Insertion Mark makes it look like the value can be edited, which is not possible with ReadOnly True.
View 5 Repliesi want to search "words with mark" in txt file.For example: i want to search: "t�m" in my txt file. but my code couldn't find that word, it could find a word "tam".[code]
View 1 Replieshow to split textbox example place a question mark in the place where you want to fill the number. if you want fill series like 1spider 2spider then type ?spider in textbox in the series box and type the from number and to number in the boxes anybody tell me example images below Textbox i want to know generate to textbox like this below image textbox
View 19 Replies