473,387 Members | 1,534 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Connectivity of ASP.NET 2.0 with SQL server 2000

Hello Friends,

I am learning ASP.NET 2.0 myself. So, I have problem for connention of
ASP.NET 2.0 with SQL server 2000 that I cant understand that So, which thing
helpful for me about this connetion Or which thing I have to learn for that
please tell me.

Thanks.
Nov 5 '08 #1
2 1226
"Trivedi Chinkal" <Trivedi Ch*****@discussions.microsoft.comwrote in
message news:36**********************************@microsof t.com...
I am learning ASP.NET 2.0 myself. So, I have problem for connention of
ASP.NET 2.0 with SQL server 2000 that I cant understand that
Firstly, you should be aware that mainstream support for SQL Server 2000
ended several months ago:
http://support.microsoft.com/lifecyc...ilter=FilterNO

I would strongly suggest that you upgrade to the latest version.
So, which thing helpful for me about this connetion
Or which thing I have to learn for that please tell me.
It's probably simplest if you say what problems you are having, and show us
your code...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Nov 5 '08 #2
Here is a simple pattern, using a dataset. I am including the entire class,
to make things easier. This is a bit of a strange pattern in some ways, but
it matches the other methodology of other classes (using table adapters), so
it will make things easier for the Junior devs who might take over the code.

The table mappings here are a bit heavy, but the basic model should work for
you if you use strongly typed datasets. I have more info on why this one is
patterned this way at:
http://gregorybeamer.spaces.live.com/blog/cns!B036196EAF9B34A8!974.entry

using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Text;
using Microtrak.UnitWarehouse.Data.DataSets;

namespace Microtrak.UnitWarehouse.Data.Repositories
{
public class UnitInfoRepository
{
private string _connectionString;

public UnitInfoRepository(string connectionString)
{
_connectionString = connectionString;
}

public UnitInfoDS GetUnitInformationByImei(string imei)
{
var ds = new UnitInfoDS();

var connection = new SqlConnection(_connectionString);
var command = new SqlCommand("FillUnitInfoDataSetByIMEI",
connection);
command.CommandType = CommandType.StoredProcedure;
command.Parameters.AddWithValue("@IMEI", imei);

//Set table mappings
var da = new SqlDataAdapter(command);
da.TableMappings.Add("Table", "Unit");
da.TableMappings.Add("Table1", "UnitModelType");
da.TableMappings.Add("Table2", "UnitManufacturerType");
da.TableMappings.Add("Table3", "Product");
da.TableMappings.Add("Table4", "ProductLine");
da.TableMappings.Add("Table5", "Project");
da.TableMappings.Add("Table6", "PID");
da.TableMappings.Add("Table7", "FirmwareVersionType");
da.TableMappings.Add("Table8", "APN");
da.TableMappings.Add("Table9", "SIM");
da.TableMappings.Add("Table10", "ShippingCarton");
da.TableMappings.Add("Table11", "Script");
da.TableMappings.Add("Table12", "FriendIpAddressGroup");
da.TableMappings.Add("Table13", "FriendIpAddress");

try
{
connection.Open();
da.Fill(ds);
}
catch (Exception)
{

throw;
}

return ds;
}

}
}
--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#

or just read it:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think outside the box! |
********************************************
"Trivedi Chinkal" <Trivedi Ch*****@discussions.microsoft.comwrote in
message news:36**********************************@microsof t.com...
Hello Friends,

I am learning ASP.NET 2.0 myself. So, I have problem for connention of
ASP.NET 2.0 with SQL server 2000 that I cant understand that So, which
thing
helpful for me about this connetion Or which thing I have to learn for
that
please tell me.

Thanks.
Nov 6 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Alex | last post by:
I have developed a VB application that uses Oracle 8i database for backend. The database server is on the local network. From my development machine, the application connects (via ODBC) to the...
3
by: Nick | last post by:
Im trying to access a sql200 database from a sql7 hosted stored procedure and this is not working. I know that SQL7 is not compatible with the MDAC for SQL 2000. Does anyone know if this is what is...
2
by: pengfrank | last post by:
I have a 500-MB full installation CD for SQL Server 2000. All I need is to install "Client Connectivity" component (about 272K) on a bunch of workstations for users across the nation. How do I...
3
by: Stephen Burch | last post by:
I wrote a Visual Studio 2000 C# Windows application. The application works fine on my local PC running Windows 2000 Pro, and it also works fine running on a server with Windows 2000 Server. But...
1
by: Darren McDowell via .NET 247 | last post by:
I have a situation, I was wondering if someone could help me. Wehave a .net web service, it runs several transactions in sqlserver 2000. We have several clients which connect to this webservice in...
1
by: Ramesh Ramesh | last post by:
I have VStudio .net installed on workstation (Windows XP) and MS SQL Server 2000 installed on Server (MS Windows 2003 Standard Edition). Can I use MS SQL Server 2000 as Back-end database for V Studio...
0
by: satyasuman | last post by:
Hi, I am using SQL server 2000 and oracle 10g. I want to use SQL Server and query Oracle and get the Info from the oracle database into SQL server. To do this, I need connectivity. Can any one...
0
by: satyasuman | last post by:
Hi, I am using SQL server 2000 and oracle 10g. I want to use SQL Server and query Oracle and get the data from the oracle database into SQL server. To do this, I need connectivity. Can any one...
4
by: raaman rai | last post by:
guys, i have recently created a server for my office wid windows server 2003. I installed sql server 2000 in the server n now i want to connect to sql server from the network clients. i tried to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.