Here is the scenario. Two networks need to talk to eachother. I have an app that has a local database in our environment that the app talks too. It is using bound controls on a datagrid using vb.net. Now we want to move the database to the other network and the only way we can have access is this network is using web services. I have a datagrid that is bound to a database and employee table. The vb.net code using the fill function and dataset embedded sql to display. The save function has code such as me.validate() and .endedit() and then uses the update method to update the database from the grid. I need to strip this out and put it in web methods. What is the easiest way to do this. I know the fill is basically a select statement i can retrieve and return a datatable from the web service, but what would be the easiest way to save from the web method. any ideas would be appreciated. unfortunately this is the way it has to be from the network standpoint.
Related
I am working on live support project for a web site. I just wrote the frontend and I created the table that I need in SQL Server and then I made a connection between SQL Server and my ASP.NET MVC project.
I watched many videos and I didn't get the part which I will start get the data from the models which are created when I made the connection I talked about.
To be clear: I wrote two Divs in web page one for the sender and one for the receiver and I give messages a variable called ̰"destination" in DB so if the value is 0 it will be insert the text in sender's div and if the value is 1 it will be insert the text in receiver's div.
The problem that I know the logic but I don't know how to apply it. Please can anyone help me and tell me how to do it? Or what is the Technique that I should work with?
You should start looking into Entity Framework to get the data from the database. I think for now you should use Database First approach which is very easy as compared to Code first approach.
To start with Database first just add new item and select ADO.NET Entity Model . This will launch the wizard where you can select EF designer from database and then you can give the connection string and all the databse you want to use
Refer below link for explanation.
http://debugonweb.com/2020/01/crud-operation-using-database-first-approach-asp-net-mvc/
Using VB.NET, I can connect to a local SQL database easily, but, trying to get more advanced graphical features, I started using SilverLight for VB.NET, and so i got this problem.
Is it possible to connect a local database, and it must be SQL, with SilverLight for VB.NET?
It must be Out Of Browser too, i'm doing a Desktop App.
If there's no really way to do it, how can i make a more beatiful system, as I don't want to make the same old windows style.
Yes, you can access a db with Silverlight. As to how, the same ways you'd do it without SL really. Personally I use EntityFramework, and create a model from my database. Then I operate on that model using the context generated.
It doesn't matter if the db is local or remote, the methods are the same - they are just connection strings after all.
I am coming from a php background background where we remotely connect to the database and manipulate everything with php code. Now in vb.net, will the performance of my desktop application be affected in anyway if i connect manually in the form_load event event instead of vb.net database source connection?
i come from both backgrounds.
yes you can manually open database BUT
you should specify the database you are using to make the best performance in your desktop application, for example:
in access database (mdb files), you should open the database once in form_load, and use it all the time, then close it before exitting the application in form_closing (this is for better performance)
while in SQL Server, you should open the database for each function then do your queries then close it after you finish.
Create a DataAccessClass.
Do your db functions in this class (update functions, select functions etc)
Connect to the db on class instantiation.
give your class the necessary work to do, and receive answers back from the class.
In essence, extract your data access from your forms, so that you can reuse your data class anywhere in your app
I am writing a Windows app and want to make sure I am choosing the right tools. Currently I am leaning towards WPF and XML, please let me know if I've made a good choice.
I have about 3,000 records. Each record has a Product Name and a Price columns.
All my app does is display these records in a DataGrid and allows the user to search for products by name. Meaning, if a user types 'chair' in an edit control, then only the Product Names that contain 'chair' and their prices are displayed in the DataGrid. That's it. Nothing fancy.
Should I use Silverlight instead of WPF? I understand Silverlight allows my app to run on any OS, while WPF requires Windows? Unless I create a WPF for browser project, I think.
Should I use XML or Access or SQL? Which database would make the SEARCH feature easiest, fastest, etc.?
Finally, should/does LINQ have any involvement in this project?
Thanks.
If its going to be a stand alone product i.e. installed a each computer and not networked in any way then personally I would go for a SQLCE database with a WPF client. Its up to you if you use LINQ, I quite like it but would be overkill for this app maybe.
The next stage up is a small app used by a handful of users in a network. In this instance I would use an access backend (assuming a fileserver is in place) with a WPF client application.
Right at the “top” of the scale would be something used by a lot of people and/or something on the web. In this case I would use SQL server as the backend and again a WPF client app or if you want it to run on other platforms then go for silverlight
I am here to write a small database application that will be running in desktop (offline mode).
I am using MSAccess 2007 as my database file and trying to write code in vb.net.
I used to write the code vb6 an usually had global variables for storing database connection and executing every query from that.
I am trying to upgrade myself from vb6 to vb.net.
do i need to read some more simple starter books also?
In .NET, talking to a database is handled with ADO.NET, which uses something called "connection pooling". The connection pool is basically a collection of open connections to your database that ADO.NET manages for you. In your code, when you create and open a Connection object, ADO.NET first looks in the connection pool to see if it already has an open connection to your data source, and if it finds one it uses that (instead of actually creating and opening a new connection). When you close your connection, ADO.NET does not really close it, but instead returns it to the connection pool.
Therefore, you do not need (and in face do not want) to maintain open connection objects inside your application (in a global variable or anywhere). The correct approach with data access in ADO.NET is to create and Open a Connection object, do whatever you need to do with the database, and then Close and Dispose your Connection.
Store the connection string in the config file (in the solution explorer, open the My Project folder and doubleclick on Settings.settings).
I'd suggest that you create one or more classes to contain your database code and let those classes convert between the database data and your application objects, most VB6 projects I saw had the GUI hard linked to the DB which can make future maintenance or new features very difficult and limits the possiblity of code reuse.
If you've got VB6 experience I'd thought that you could probably start trying to create the application right away but you should definitely read either a good book or good articles about it at the same time so that you pick up things like that you need to Dispose of your database objects after user etc.
It's probably a good idea to get a book, a lot has changed since VB6.
Also consider using a more robust db, like SQL compact or SQLite. It will allow you you use the Entity Framework which will make writing your app a whole lot easier.