.net - Mark Property As Key In POCO?
Mar 9, 2012
I 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]...
View 1 Replies
ADVERTISEMENT
Mar 6, 2011
I face problems while transferring objects between layers (mainly the Presentation Layer), as I work with classes having approximately 40 properties.(I don't reference the DAL in the Presentation Layer)So here's what I decided, I am planning to build an App (maybe Visual Studio Addin) which will help noobs like me to build POCO's rapidly.The GUI of the APP would probably be a datagrid with columns for
1) access modifiers
2) property name
3) data type
4) get method (checkbox)
5) set method (checkbox)
Also, the app will have an option to connect to the table and automatically generate a POCO class I would like to generate Strongly typed C# / VB.NET POCO classes for different Scenarios, Like Entity Framework, LLBLgen etc. I am mainly targeting LLBLgen and EntityFramework?I need the following information:
1) Is there such a tool which already exists
2) What are the things that I have to consider (like nullable types etc)
3) The DataTypes generate by ORM's LLBLgen/EF/nHibernate
View 2 Replies
Feb 18, 2011
Ok... So I have created my model using EF4. Great!I then turned off the code generation and downloaded this extension: [url]...Ran it, and it generates all of my classes. Is that all I have to do? It seems to work, my repositories get to the objects and persist to the DB.
[code]...
Where does the service layer fit in?What about the AutoMapper? Do I even need to use that now?Dependency Injection?
View 1 Replies
Jan 25, 2012
I have a webpage with a form that is used to edit some object. This object contains a Collection of other objects defined like this: Public Overridable Property Employees As List(Of Employee)
On a form I can delete an employee, add a new one or modify existing one. When I click save new values are sent to the server. On a server I check if the user exists. If exists then I modify its values, if it does not exist then I add it. All employees that exist on the server and were not sent are marked as deleted (State changed to EntityState.Deleted). I try to use the following code (dbCollection = database entities, newCollection = collection sent from the form):
[Code]...
This code does not work, because changing to EntityState.Deleted removes the object from collection, and for each loop breaks, since the collection is modified...I know that I can overcome this problem by using a for loop or adding objects to delete to some other list first, but I hope maybe there is a pattern that would make my code nicer.
View 1 Replies
Dec 9, 2011
I'm having some very weird issues with interfaces right now.
I have a very simple setup. In one of my class, I have a Property implementing a Property from an Interface.
In my class it's like:
Private _oForm As IForm
Public Property Form As IForm Implements IContainer.Form
Set(value As IForm)
[Code]...
I have like dozens of interfaces like this working throughout my project and I can't believe this simple one can't work!
View 1 Replies
Jun 20, 2012
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 Replies
Nov 16, 2011
The 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]......
View 2 Replies
Aug 5, 2009
Is 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 Replies
Sep 17, 2009
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 Replies
Mar 1, 2011
Possible 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 Replies
Nov 24, 2011
I 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??
View 1 Replies
Dec 6, 2010
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!)
View 2 Replies
Aug 8, 2011
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 Replies
May 15, 2011
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 Replies
Sep 26, 2009
Private 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?"
View 3 Replies
Jul 23, 2009
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 Replies
Jul 14, 2009
Lets 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]...
View 6 Replies
Nov 9, 2010
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:
View 10 Replies
Mar 10, 2006
I am encountering a problem. I want to write a string into a text file, and string is:
[Code]....
View 9 Replies
Dec 1, 2011
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)
View 2 Replies
Oct 19, 2011
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]....
View 2 Replies
May 30, 2012
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].....
View 2 Replies
Nov 9, 2010
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 Replies
Oct 24, 2011
How 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 Replies
Oct 27, 2009
Update: (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].....
View 1 Replies
Aug 22, 2011
In .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.
View 1 Replies
Apr 11, 2012
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 Replies
Apr 10, 2012
I 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 Replies
May 27, 2009
i 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 Replies
Apr 21, 2012
how 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