15,900,110 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Mr.McCloud (Top 16 by date)
Mr.McCloud
4-Jan-13 12:51pm
View
Alright, thanks for the advice on the concatenation. I never knew it was bad practice the way I've been doing it. I'll definitely start using a better method.
And I guess when it comes to the partial class, I was just hoping for an easy solution to my problem. I've never fully understood exactly how the VB.NET code that I used worked in the first place.
I think the best thing to do, is go back and first learn what the VB.NET code is actually doing, and then I can probably translate that logic somewhat into C#
Thanks for the help.
Mr.McCloud
3-Jan-13 17:27pm
View
Okay scratch that.
The inheriting works and FirstName and LastName are both now treated as objects in the table.
Mr.McCloud
3-Jan-13 17:11pm
View
It can't recognize FirstName and LastName as columns.
I don't think Employee in C# is actually referencing the Employee table like it does in VB.NET. I tried getting it to inherit from the Employee's table but its not an option to inherit from.
Do you know how I can make sure Employee is actually a partial class of the Employee table instead of just a new class?
Mr.McCloud
11-Oct-12 15:27pm
View
Alright, I've tried it and it works perfectly. Thanks for the help. Much appreciated.
Mr.McCloud
11-Oct-12 15:21pm
View
Hmmm, I think I'm getting it. Do you mean then that instead of declaring it at the top, I should declare it in the actual procedure its being called in?
By the way, thanks for the help so far.
Mr.McCloud
11-Oct-12 15:16pm
View
Hmmm...do you mean like:
"Dim Context as DataAccessLayer.Entities = New DataAccessLayer.Entities" ?
This is how I declare my context in every form. Except of course, with the actual names of the entities and such.
Mr.McCloud
20-Jul-12 9:06am
View
Thanks and I know how to use arrays. I just haven't found the need to use them much, so I haven't looked into it as much and my memory is unclear.
Anyways, thanks for the answer. I appreciate it.
Mr.McCloud
18-Apr-12 17:40pm
View
Deleted
Update:
The solution I proposed didn't fix the problem like I first thought. I still have the same problem of it not always deleting the correct entity, the solution I proposed seems to be more accurate though, but not perfect.
Mr.McCloud
11-Apr-12 15:36pm
View
Yeah, this is just a small bit of my code that I copied.
Mr.McCloud
30-Mar-12 16:45pm
View
Alright, thanks a lot. I'm not very familiar with partial classes, so I'll look into it.
Mr.McCloud
9-Mar-12 11:44am
View
Wow I can't believe I made such a simple mistake. That did the trick. Thanks a ton for the help and a ton of thanks to Mark Nischalke too. By the way, it seems I can't make a comment as a solution. Can you retype this comment as the solution to my problem?
Mr.McCloud
9-Mar-12 11:27am
View
Deleted
Imports NEIPurchasingDAL.PurchasingDatabaseEntities
Imports System.Data.Objects
Public Class MainForm
Private PE As NEIPurchasingDAL.PurchasingDatabaseEntities = New NEIPurchasingDAL.PurchasingDatabaseEntities
Private MyUser As String = My.User.Name
Private Sub MainForm_FormClosing(sender As Object, e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
Dim LogoutTime As String = Now.ToLongTimeString
Try
Dim LoginData As NEIPurchasingDAL.LoginData
LoginData = (From LoginDatas In PE.LoginDatas
Where LoginDatas.LoginID = LoginForm.LoginID
Select LoginDatas)
LoginData.LogoutTime = LogoutTime
PE.SaveChanges()
Catch ex As Exception
MessageBox.Show(ex.Message, ex.GetType.ToString)
End Try
LoginForm.Visible = True
End Sub
End Class
Mr.McCloud
9-Mar-12 11:26am
View
Deleted
Imports NEIPurchasingDAL.PurchasingDatabaseEntities
Imports System.Data.Objects
Public Class LoginForm
Private PE As NEIPurchasingDAL.PurchasingDatabaseEntities = New NEIPurchasingDAL.PurchasingDatabaseEntities
Public LoginID As String
Private Sub LoginForm_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Dim MyUser As String = My.User.Name
Dim MyUserName As String = Replace(MyUser, "NEIHERRIN\", "")
tbUsername.Text = MyUserName.ToUpper
End Sub
Private Sub btnLogin_Click(sender As System.Object, e As System.EventArgs) Handles btnLogin.Click
Dim MyUser As String = My.User.Name
Dim LoginDate As String = Today.ToShortDateString
Dim LoginTime As String = Now.ToLongTimeString
Dim MyUserName As String = Replace(MyUser, "NEIHERRIN\", "")
MyUserName = My.User.Name
Dim LoginDataRecord As New NEIPurchasingDAL.LoginData
With LoginDataRecord
.Username = MyUserName
.LoginTime = LoginTime
.LoginDate = LoginDate
End With
PE.AddToLoginDatas(LoginDataRecord)
LoginID = LoginDataRecord.LoginID
PE.SaveChanges()
MainForm.Show()
Me.Visible = False
End Sub
End Class
Mr.McCloud
9-Mar-12 11:26am
View
Deleted
I believe I'm making this harder than it should be. Here's the code from my two forms. I tried to cut out the extra code.
Mr.McCloud
9-Mar-12 11:09am
View
Yeah, that's basically what I'm trying to do. I just don't know the code that will allow me to do this. Finding Entity Framework code in Visual Basic online can be very difficult.
Mr.McCloud
9-Mar-12 11:07am
View
Yeah
Show More