.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Need some advice on database runtime manipulation

Posted By:      Posted Date: September 23, 2010    Points: 0   Category :Sql Server


I've written a database app (Visual C# Express 2010 and Compact 3.5) using the standard drag-and-drop tools. This all works as expected but I want to extend the functionality to allow users to open any database with the same schema i.e. not restrict them only to the "hard coded" database.

This is where things get problematic for me. Can I use the existing project as a "template" and somehow associate any conforming database with it? Is there any better way of achieving this?

Any advice or (even better) sample code/tutorials/links will be greatly appreciated.

View Complete Post

More Related Resource Links

SQL Server Database Engine cannot obtain a LOCK resource - Advice VERY welcome

Since about 07:47 this morning (which is why I fired up a web browser running several programs which used databases on this server) I have been seeing the following error: Event Type: ErrorEvent Source: MSSQLSERVEREvent Category: (2)Event ID: 1204Date: 14/10/2009Time: 10:54:23User: CD\REMOTESERVER$Computer: SQLSERVERDescription:The instance of the SQL Server Database Engine cannot obtain a LOCK resource at this time. Rerun your statement when there are fewer active users. Ask the database administrator to check the lock and memory configuration for this instance, or to check for long-running transactions. For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.Data:0000: b4 04 00 00 13 00 00 00 ´.......0008: 09 00 00 00 43 00 4f 00 ....C.O.0010: 4c 00 4f 00 53 00 53 00 L.O.S.S.0018: 55 00 53 00 00 00 06 00 U.S.....0020: 00 00 53 00 55 00 53 00 ..S.U.S.0028: 44 00 42 00 00 00 D.B... I ran through the guidance provided, but we cap memory use at 16GB and the server is not using more than 5GB. I looked at current locks and no process was using more than 4, a total of about 110 all told. We don't cap connections, indeed we pretty much run with the default SQL settings. The only issue I can see relating to SQL was a failed patch attempt Event Type: ErrorEvent Source: Windows Update AgentEvent Category: Installation Event ID: 20Date: 14/10

how to bind menu dynamically at runtime to database

Hi I'm new to ASP.Net. I need to bind data to menu navigation control from DataBase. These are the Tables I have...I know how to bind data from web.sitemap and xml, but not through database. If any changes are made in database, then automatically it should update in menu navigation control..plz guide me... Services --> E - Learning Education Software Products --> Education Individuals Corporate Customers --> Testimonials Careers --> Work Culture Current Openings About US --> Quality Policy Our Founder Our Team Thanks in Advance... even i can write code for it .but the main problem is that i dont know how i should create table structure .also navigate url column plz help

How to load "Database Instance" for "Database Trace Listener" at runtime



I have been searching for a while now without success. On how when using EntLib 5.0 Logging, Data; to be able to set the database (i.e. the connection string) at runtime for a Database Trace Listener. The reason being we will have the same configurations on all levels of the environments (dev, test, stage, prod), but the connection string is different for each and we do not store the connection string data in the config file. The connection string data is loaded using a custom configuration manager for security reasons.


Any help and any code sample much appreciated. 



New to asp.net looking for advice on building application framework for database web app


Hi everybody, I am looking to build a web application from the ground up. I have done a bit of research, however I just thought I would post here to see what kind of responses I get. Any input is greatly appreciated! I will give a brief description of the type of application I am trying to build.

It will be a database web app for managing clients and financials of those clients.

The application will need a secure log on system for approximately 160 end users, with the ability to change permissions for each user given their individual rights.

Depending on the type of user created they will have access to 1 of 7 unique application modules within the app framework.

A data dictionary will be designed and created prior to starting the project as the 7 unique application modules will have common database fields and custom relationships.

Based on this information, what asp.net tools, libraries or books would you recommend using? Thanks in advance!

ADO.Net [How to create database at runtime]



I am trying to accept database name from user and then it must create the database with that name. How to do this? I have a label, a textbox (text box is the input from user)and a button in the form. In the button, I write these codes.  But I get exception error at cmd.ExecuteNonQuery(); . Any help? Thanks. Code is,

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace Create_database_parameterized_query
  public partial class Form1 : Form
    public Form1()

    private void button1_Click(object sender, EventArgs e)

Getting column' names form database in runtime ?


How can I get columns' names in runtime?
I tryed this:

Dim con As New SqlConnection

Multiple database support with Entity Framework

One of the features introduced in Entity Framework is being database independent. Which mean each database provider can support Entity Framework by implementing its provider.

This feature allows you build applications independent from the underplaying database provider. In this post I'm going to show how to build an application that support multiple databases using same conceptual model made by Entity Framework.

Export Visio Database Table Names to Excel

If you use the Enterprise Architect edition of Microsoft Visio for data modeling regularly, then there is a good chance that at some point you've wanted to export just the table names into Excel. You might want to do this to map logical ERD entities to physical data model tables, track project status by entity, or track overlap between database versions.

MS SQL Server: Disconnect Users From Database - Kill User Session

If you ever wanted to restore your database from a SQL backup file (.bak), but there are still users connected to your database, the backup operation will fail causing the error: Exclusive access could not be obtained because the database is in use.

Publishing SQL Server Database using Publishing Wizard : Tips & Tricks

We can use SQL Server Publishing Wizard to deploy our local Database to remote hosting server/production server.This feature is available in SQL Server 2008/VWD 2008.

Below is the complete step by step guide of this process.

Adding Rows in GridView without using a Database

This article describes on how to add rows in GridView without using a database. Basically the GridView will be populated with data based on the values entered in the TextBox on Button Click and retain the GridView data on post back.

Adding Multiple Columns and Rows in GridView without using a Database

This article describes on how to add multiple columns and rows in GridView without using a database. Basically the GridView will be populated with data based on the values entered in each TextBoxes on Button Click and retain the GridView data on post back.

ASP.NET Database Tutorial

This tutorial will show you how to display data using the .NET GridView Control, ASP.NET 2.0 and VB.NET

The GridView control is a powerful tool and is simple to implement.

First, you will need to import the System.Data.SqlClient namespace.

Create And Run Excel Macro At Runtime in C#

You've been tasked with writing a Windows Form application using the .NET Framework that interacts with Microsoft Excel. If you are new to working with Excel in .NET and are having trouble learning how to format certain cells or cell ranges, then this little tip will come in handy. Rather than scour the internet hoping to find the correct set of constants or method syntax for formatting your spreadsheet, use the built in tools in Excel to write the familiar VBA code for you. Then, you can paste the VBA code generated by Excel into the sample C# code below and run it dynamically at runtime.

Connestion string create any database server

This links important to how to create connection string to any data base sever.

SQL Server Database Transaction

A transaction is a group of SQL commands executed together as a single component of work to be accomplished. If all of these commands succeed, then a transaction is committed - the changes to the data are made final. If any of the commands within a transaction fail, then the entire transaction is cancelled, or in SQL Server terms, the transaction will be rolled back.

Transactions are one of the things that keep your data safe, but they're not necessarily easy to understand. Here's some help:

Database Export Wizard for ASP.net and SQL Server

A step wizard for ASP.net to export database objects to CSV, TXT, HTML, XML, or SQL. it guides users through a few simple steps to choose a database object (table, view, or query), select columns, and export the data in any of the standard formats CSV, HTML, XML, or SQL.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend