.NET Framework - sample code

Asked By Richard Douglass
16-Nov-09 12:54 PM
I have been asked to convert a VB6 app into a web-based client.  It will be
accessing a MS SQL database and make calls to store procedures.

Does anyone have a basic template I could use for a generic form that has
sample code for the DB calls?

Thanks!
Richard
  Catherine Sea replied to Richard Douglass
18-Nov-09 03:56 AM
Hi Richard,

You may take a look at this article to see if it helps:
http://support.microsoft.com/kb/306574

Thanks,

---------------------
Catherine Sea
http://www.dynamsoft.com
http://www.scmsoftwareconfigurationmanagement.com
help
values IDictionary<String, String> _scripts: foreach (KeyValuePair<String, String> s in _scripts) { s.Value.Replace("$Database", Database); s.Value.Replace("$Login", Login); } However, the values are not replaced. I think I need to use the following: s.Value = s.Value.Replace("$Database", Database); But the problem is that I cannot do this in a IDictionary value. How can this problem? Thank you, Miguel C# Discussions Exception (1) ToArray (1) Strings (1) Login (1) Database Database (1) IDictionary (1) Arne Vajh (1) Replace (1) The easy solution is to do the then try: foreach (KeyValuePair<String, String> s in _scripts) { _scripts[s.Key] = s.Value.Replace("$Database", Database).Replace("$Login", Login); } Arne Which does not work, because the collection is considered modified so
Visual Studio Database Professional - Database Reference .NET Framework I have created a SQL 2000 database project. I used the 'import database schema' to import my db. that database has references to MSDB. I am getting the error TSD3025: The following cross-database dependencies could not be verified: [msdb].[dbo].[syscategories], [msdb].[dbo].[syscategories].[name], [msdb].[dbo].[sp_add_category need to create a project for MSDB in my solution? - - Jeff Visual Studio .NET Discussions Database (1) SQL Server (1) Microsoft (1) Microsoft Office (1) Visual (1) MSDN (1) Studio (1 description, you're encountering some problem when try doing some operation in a visual studio database project against Sql 2000 database, correct? According to the error info you provided, the problem
Design .NET Framework Hi there, I am writing a simple program that will connect to database. Database has 2 tables, let's call them father and child. This is one to many and delphi. So I used to create separe class that corresponded to each table in database. In Father class I used to crate an array of child. whenever Father was inserting new record to database, it was also inserting corresponding record(s) into child. I can easly do it, but is the best way to do it. For instance, if there are 2 tables in database (father and child) Father has Id Integer FatherName String Child has Id Integer (corresponds to How to design 2 classes fot both tables? Thanks, John VB.NET Discussions NHibernate (1) Database (1) Otherwise (1) Insert (1) Delete (1) You can use a Typed Dataset. . . or take Proper, Design description: Hi there, I am writing a simple program that will connect to database. Database has 2 tables, let's call them father and child. This is one to many
var db = new MyDb(connString); causes creation of all objects corresponding to all tables in database. Database contains 500 tables. Application accesses only few tables at a time. Creating large number of 1) MyDataGridView.DataSource (1) System.ComponentModel (1) TypeDescriptor (1) LLBLGen (1) You could partition your database into several contexts. Are you sure this is actually an issue for you though? How sorry I was not clear. The actual issue with that is that loading some of database tables requires creating and loading additional assemblies at runtime. Creating those assemblies requires some database access also. Since all 500 tables are loaded always I'm afraid that creating always all assemblies for all tables with database acess decreases perfomance a lot. So I'd prefer to create table objects only when required. I'm looking for a way to modify database class to implement delayed loading using table object getters or cache some data in isolated ItemBase ( string idItem, string name, int price ); } } In AssemblyResolve event I retrieve additional properties from database and create wrapper assemblies like: first assembly: namespace Entity { [Table(Name = "customer")] public class Customer
Database Pro - Encrypted Proc .NET Framework Is it possible to import a database using Database Professional when the stored procedures are encrypted? Visual Studio .NET Discussions Database (1) The problem was that I did not have "View Definition" authority on the proc. keywords: Database, Pro, -, Encrypted, Proc description: Is it possible to import a database using Database Professional when the stored procedures are encrypted?