ComboBox Value - Each Model # Correspond With A Different Id #

Mar 27, 2010

Hey I am a newcomer to Visual Basic. I am using VB 2008 Express. My problem is I have a combo box filled with model #'s and I would like to have each model # correspond with a different id #, but I have no idea on how to do this, and I have found no documentation on it.

View 8 Replies


ADVERTISEMENT

Two Listboxes Data To Correspond To Each Other?

Sep 8, 2009

Two listboxes data to correspond to each other

View 1 Replies

Create A Class That Has Properties That Correspond To Column Names In A Database Table?

Feb 24, 2009

I want to create a class (I think) that has properties that correspond to column names in a database table, such that they come up in Intellisense when I type the dot after the class name. Is this possible to do?

View 5 Replies

Error : Unable To Open Web Project 'ProjectName'. The File Path 'FilePath' Does Not Correspond To The URL 'ProjectURL'

Dec 4, 2009

I am getting the following error when trying to open a vb .net 1.0 project using VS2002."Unable to open Web project 'ProjectName'.The file path 'FilePath' does not correspond to the URL 'ProjectURL'. The two need to map to the same server location. HTTP 404: Object Not Found."I have tried ALL of the links that Google threw at me (on the first page) on searching on "unable to open web project the two need to map to the same server location" term.I get this error when trying to open an existing vb.net 1.0 project and also when creating a new one.

View 1 Replies

VB - Excel: Finding If A String From One Column Correspond To Strings In Another Column?

May 20, 2009

i need to do a macro. this is what my excel looks like

1 2 3 4
seq1 name name seq2
abcde vv1 abcdddd
abcxy vv2 abcdlmn

[code]....

View 1 Replies

.net - Circular Dependency Between MODEL And BLL?

Sep 1, 2011

Assuming an architecture as such.MODEL > BLL > DLL

Trying to implement lazy loading in my MODEL I have run into a circular dependency between my MODEL and BLL..Basically imagine a property in my model that I want to implement as follows

Public Readonly Property ProjectCategory As ProjectCategory
Get
If Me._ProjectCategory Is Nothing Then
Me._ProjectCategory = ProjectCategoryBLL.GetProjectCategoryByID(Me._ProjectCategoryID)
End If

[Code]...

I have my MODEL, BLL and DLL in separate projects and because of the fact that my BLL references my model I can not reference my BLL from my model as this would create a circular dependency.

View 3 Replies

Asp.net MVC3 Appropriate Model Passing

May 24, 2012

I'm quite new to MVC and while I've been trying to follow the best practices , I believe I may not be understanding certain fundamentals of either

-a. Using models and viewmodels appropriately

-b. Passing models into a controller for validation purposes.

The general purpose of my program is to select a stored procedure from a list of stored procedures, create a form where the user can fill out all the appropriate input variables, and then to execute that stored procedure. The tool is for non-technical people, so I'm eventually going to have to do a good deal of input validation.

As such I have four models: A Script Model, a Parameter Model, a Parameter Enum model and a Query Model, and two viewmodels: a paramviewmodel that generates the form to fill out, and a scriptviewmodel that creates a listbox filled with the possible script choices. I am using a prewritten database system to fill out my viewmodels in an init method in my controller (which I'm not sure is the proper way to do this?).

The viewmodels are as follows:

Imports System
Imports System.Collections.Generic
Public Class ScriptViewModel

[Code]....

I'm trying to work out the functionality. Also, I think this may be too much code in the view, even though most of it is display code.

Anyways, I have two main questions. One, does creating a model in my controller, calling an init method on it, and then passing it to the view make any sense in an mvc context (if not, how would I proceed?). Two, if I want to perform validation on the form I output in my htmlhelper, but I want to use my query model validation (and not my paramviewmodel), how can I do that? Most of the examples I've seen involve a controller that recieves an appropriate model variable, and the binding is performed outside the controller itself. They then just check modelstate. Is there any way I could do something similar here?

Edit: Is there any way I can make the syntax highlighting less crappy?

View 1 Replies

Best Way To Implement A Certain Part Of Model

Feb 13, 2011

I am trying to figure out the best way to implement a certain part of my model.I have an entity named Customer which has CustomerLocations (1-*) which have SalesOrders (1-*) which have Invoices (1-*).I want to allow them to have multiple addresses (Billing and Shipping) per customer and per location. I want to store those values in the sales orders and invoices, not a foreign key, what if they delete one of their addresses later down the road.I have tried complex types, but then they can't have multiple, can they? And having an Address entity, customer --> address (1-*) is ok, but a bit clumsy. How would you have a collection of billing and shipping addresses.?

View 1 Replies

Best Way To Use NHibernate With The Repository Model

Mar 16, 2009

I have a repository class that defines some basic Get/Save/Delete methods. Inside these, I use NHibernate to do the work on my business entities. For example:

[code]...

However, on my User class I have some properties and collections of other objects that ideally I'd like to be lazy loaded. But of course, the ISession is created and disposed within the repository, which I guess is why, outside of that, when I try to access those properties I get a "Could not initialize proxy - no Session" error.Is my only option then to disable lazy loading when using repositories? Or is it possible (or just foolish) to somehow get the session into scope in the business layer?I do like the repository model, and NHibernate is growing on me (after lots of initial frustration trying to make it work), so what's the best way you gurus have found of using them together?

View 1 Replies

Dynamically Set An Item In A Mvc Model?

Jun 19, 2012

how to phrase my question, but what I am trying to do is inside a for each loop set the item of a model then set the value of that item.

dim td as new project.model.mymodel create model object
For each dr as datarow in dt.rows
dim itemName as string = convert.tostring(dr("Field"))
td.itemName = "6"
next

I keep getting an error that itemName is not part of collection td

View 2 Replies

Get Model For Currently Selected Printer?

Mar 29, 2012

I have a program that prints raw code to Zebra printers. We are adding some Intermec printers. So I would like to be able to pull the Model of the Printer (selected from a standard printer dialog) and use that to chose the code that would be sent to the printer.

View 8 Replies

Load A .x Model From A Folder?

Jan 31, 2009

how do I load a .x model from a folder and then show it in a box(a picturebox?) on a form?

I know it would use DirectX.

I've looked all over the place for how to do it but can't find any ways

View 2 Replies

Tossing Up Between A Desktop And A Web Model?

Jan 10, 2009

My name is Mal, I live in Pelican Waters, Queensland, Australia.There is an application I'd like to build and I have been tossing up between a desktop and a web model. I have been studying PHP and Javascript for the past 2 years. I was studying VB a couple of years ago and have returned to it recently.

View 6 Replies

Asp.net - @Model Not Supported In Razor Views For VB?

Feb 27, 2011

Is not the @Model MyModelClass notation not supported in VB Razor Views? It's not working for me. What is the construct for it?

View 1 Replies

Asp.net Mvc - Drop Down Troubles In .net Using VB And View Model

Jul 12, 2010

I am new to .net, I am just taking a shot in the dark through this whole thing. I have an Addresses table with a StateID and CountryID field. They refer to the States and Countries table. I am using LINQ to SQL and Visual Studio 2010.

[Code]...

View 1 Replies

Asp.net Mvc - Post IDictionary Back To MVC Model

Dec 18, 2009

To make this easier I will use a concrete example using movies and genres. A genre can be associated with many movies. Genres can increase over time and so can movies.

The use case is as follows. The user wants to filter movies by selecting his/her desired genres.

So, I have a page where at the top there is a section where the user can pick any combination of genres to filter on using checkboxes. Below that is a list of movies that are in those genres.

In MVC I am trying to implement this using a ViewPage(of IDictionary(of Genre, Boolean)) where the boolean is whether or not a particular Genre has been selected for filtering.

I then go into loop that creates checkboxes for them to select:

<% for each genre As KeyValuePair(Of Genre, Boolean) in Model %>
<%=Html.Hidden("genre[" & i & "].Key", genre.Key.ID)%>
<%=Html.CheckBox("genre[" & i & "].Value", genre.Value)%>

[Code].....

I am aware this can be done using Ajax and I will most likely do it using Ajax but I would still like to know why this doesn't work.

View 1 Replies

Entity Model Not Being Updated On SaveChanges?

Dec 1, 2011

I have a misunderstanding somewhere with the Entity Framework. This code is from my unit testing:

Public Sub UpdateRosterLinkTest()
Dim target As PlayerAdmin = New PlayerAdmin()
target.PlayerAdminManager = playerAdminTestManager
target.Team = playerAdminTestManager.GetAirForceMensBB()

[code]....

When I run this code, I can see the changes saved to the SQL Server this pulls from (RosterLink = Roster Link, like I set in the unit test).However, my unit test is failing, because team.RosterLink is still Nothing. The function GetAirForceMensBB() returns the Team with TeamId = 12434:

Function GetAirForceMensBB() As DAL.Team
Return (From team In Container.Teams Where team.TeamId = 12434).SingleOrDefault
End Function

I'm sure I'm using the entity framework incorrectly and it probably has something to do with the fact that I am calling the PlayerAdminTestManager in different places, but I don't understand why. Although, I set the PlayerAdminManager to be the PlayerAdminTestManager. PlayerAdminTestManager extends PlayerAdminManager, fyi.Why is team.RosterLink not showing the update from UpdateRosterLink?

EDIT:Container is my ObjectContext. This is how I access the information stored in the database.Container.Teams represents my Teams table.

View 1 Replies

Fetching Data From Simulated Model?

Mar 29, 2012

fetching data from simulated model

View 1 Replies

Generate A Entity Model From SQL Server?

Feb 6, 2012

I am using MS Visual Basic Express 2010 and trying to generate "ADO.Net Entity Framework" entities from an existing local SQL Server Express database.

Using the "Entity Data Model Wizard" I am asked to configure a connection. Here I prompted to choose a "Data source" and given two options 'Microsoft SQL Server Compact 3.5' and 'Microsoft SQL Server Database File'. I select the second option.

I'm then prompted for connection properties, I have to enter the "Database file name (new or existing)". Here I browse to the SQL server database file of interest (found using Management Studio Express) namely[code]...

View 7 Replies

How To Model An Array Function To Fit My Script

Oct 26, 2009

I am in the process of using a two-dimensional array to find wind chill factors. My application uses a nudTemp for temperature and nudWind for Wind Velocity. When temp and wind are chosen from the nud list, it is supposed to display the wind chill temp in a text box and then display a message box. Right now it does everything it is supposed to do except that it does not display the proper wind chill factor.

I know it is an issue with my arrays so I was provided with an example but I don't know how to modify it so that it matches my code. I have added all of the array values but it is naming the array variables I am having issues with.

Sample code I was provided:

Private arr1 As Integer() = New Integer() {10, 20, 30}
Private arr2 As Integer() = New Integer() {100, 200, 300}

[CODE]...

I have provided my code as I have it thus far, listed below.

Option Strict On
Public Class frmWindChill

Dim intWindChill(7, 5) As Integer

[CODE]...

View 1 Replies

How To Assign Prices To Each Model From The Combo Box

Mar 3, 2009

Anyway for my vb class we need to write an auto inquiry system. Im a total n00b and am struggling altogether. My interface is below Basically what my problem is (among others) is that I don't know how to assign prices to each model from the combo box. This is what I used to populate the two boxes:

[Code]...

View 9 Replies

How To Retrieve Computer Model Information

Oct 18, 2009

How do I retrieve the computer model information?For example, I have a dell inspiron 1545. How do I retrieve that information in a label? I search a lot of WMI information but can't seem to find it. It SAYS 1545 on my system properties

View 5 Replies

Mathematical Calculation Model Code?

Jan 7, 2009

i need mathematical calculation model code.

View 2 Replies

MVC (Model-View-Controller) Implementation In .NET?

Apr 26, 2009

I am wondering what I am missing in the attached code that is making it impossible for me to make the VB.NET program below work using MVC (Model-View-Controller). Right now, I am really lost despite my best efforts...

I am trying to implement the observer pattern and think that my code is getting closer to MVC but not quite there yet, firstly because it wont even run ... nevertheless I know that there is someone out there who knows what I am doing wrong and I would definitely benefit from any guidance or help that someone more experienced in MVC VB.NET implementation can give .. hence this letter.

[Code]...

View 6 Replies

Mvc - Using Model View Control Pattern With Either VB Or C#?

Jul 3, 2009

Does anyone have a good website for the basics of using Model View Control pattern with either vb.net or C#.

View 1 Replies

Open Source - What Is The Model .NET Sample App

Sep 16, 2009

I'm looking for an open-source VB.NET app that demonstrates a lot of .NET's power, ideally something that works fully offline. Maybe some of you have encountered an amazing utility app on CodeProject?

View 1 Replies

Place Connection String In Model Or GUI?

Jul 27, 2011

I have a VB.NET 2010 solution, that contains 2 projects, a class library and a Windows Forms Application.The class library basically is a model, used for doing database integration. I currently have the connection string placed in the class library project settings, but they do not seem to be listed anywhere in the config file of the application. What's the best practice for retrieving the connection string in the class library? I don't want to use a singleton. Should it be stored in the application or class library?

View 2 Replies

Syntax To Declare Single Model In MVC

May 18, 2009

I'm trying to avoid the use of magic strings as much as I can, but I can't find the correct syntax for VB to bind a single model like is shown in this c# example. (Currently the below says "expected end of statement" under the Model text).
<% Dim FormObject As Form = (Form)Model %>
A simple directcast was need
<% Dim FormObject As Form = DirectCast(Model, Form)%>

View 2 Replies

Using EF Model Database Not Updating With UpdateModel

Mar 9, 2012

MVC 3, VB.NET, RAZOR app, using EF. I am having an issue in my post function with the database not updating at all... Using a break at db.savechanges() I look at the variable and all of the correct information is contained in the UpdateModel( ) part. But no dice the code executes and returns no errors so all looks fine but when I look at the database table it has not been changed at all, all of the old values are still present.. Function is as follows:

<AcceptVerbs(HttpVerbs.Post)>
Function EditCourse(ByVal _eCourse As cours) As ActionResult
Dim id As Integer = _eCourse.course_id

[Code]....

View 1 Replies

Which Error Handling Model Is More Robust?

Sep 13, 2009

I'm kind of torn between these two error-handling models:Create a boolean Error and a string ErrorMessage property for your object. Catch all exceptions internally in the object's methods and pass the messages along using conditional logic from the caller, ie:

[Code]...

To me, it seems like the same amount of code either way, except that you have property code for the Error and ErrorMessage properties. However, you also can tell when an error occurs without having to check for exceptions. Which pattern should I go with?

View 6 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved