Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 18, 2012 04:45 AM by Decker Dong - MSFT
Member
442 Points
292 Posts
Dec 17, 2012 04:44 PM|LINK
Hi
my question when we add linq to sql class is it necessary to give first name same as database name
eg NorthWindClasses(Here we are connecting to Northwind Database in sql server 2008
if we connect to Pubs Database is it necessary to give it name as PubsDataClasses.dbml
following is snap shot
which i downloaded from
http://www.c-sharpcorner.com/uploadfile/scottlysle/linq-to-sql-in-C-Sharp/
thanking you All
Star
11600 Points
1781 Posts
Dec 17, 2012 04:56 PM|LINK
It isn't necessary. If both the databases are same than you can change connection string in that file or set connection string in settting file.
Dec 17, 2012 05:06 PM|LINK
meaning
NorthWindDataClasses.dbml may be (for NorthWind Database)
1. NWDataClasses.dbml
2. NDataClasses.dbml
3. WDataClasses.dbml
all are ok !
Contributor
5132 Points
1465 Posts
Dec 17, 2012 05:34 PM|LINK
Anil Srivastava Anil Srivastava
Anil Srivastava all are ok !
Yes, you can arbitrary name it, Whatever you want.
But the Sync word'd better.
Dec 18, 2012 01:46 AM|LINK
I got the point
below code is to populate 4 columns on page load
NorthwindDataContext db = new NorthwindDataContext(); var query = from p in db.Products select new { p.ProductID, p.ProductName, p.QuantityPerUnit, p.SupplierID }; GridView1.DataSource = query; GridView1.DataBind(); thanking You All
All-Star
118619 Points
18779 Posts
Dec 18, 2012 04:45 AM|LINK
Hi,
If your problem is solved, I'll mark yours as an answer to close this thread.
And if there's anything urgent, please freely feedback by creating another new thread.
Reguards!
Anil Srivast...
Member
442 Points
292 Posts
Linq To Sql Class
Dec 17, 2012 04:44 PM|LINK
Hi
my question when we add linq to sql class is it necessary to give first name same as database name
eg NorthWindClasses(Here we are connecting to Northwind Database in sql server 2008
if we connect to Pubs Database is it necessary to give it name as PubsDataClasses.dbml
following is snap shot
which i downloaded from
http://www.c-sharpcorner.com/uploadfile/scottlysle/linq-to-sql-in-C-Sharp/
thanking you All
Nasser Malik
Star
11600 Points
1781 Posts
Re: Linq To Sql Class
Dec 17, 2012 04:56 PM|LINK
It isn't necessary. If both the databases are same than you can change connection string in that file or set connection string in settting file.
Skype: maleknasser1
Anil Srivast...
Member
442 Points
292 Posts
Re: Linq To Sql Class
Dec 17, 2012 05:06 PM|LINK
meaning
NorthWindDataClasses.dbml may be (for NorthWind Database)
1. NWDataClasses.dbml
2. NDataClasses.dbml
3. WDataClasses.dbml
all are ok !
thaicarrot
Contributor
5132 Points
1465 Posts
Re: Linq To Sql Class
Dec 17, 2012 05:34 PM|LINK
Yes, you can arbitrary name it, Whatever you want.
But the Sync word'd better.
Weera
Anil Srivast...
Member
442 Points
292 Posts
Re: Linq To Sql Class
Dec 18, 2012 01:46 AM|LINK
Hi
I got the point
below code is to populate 4 columns on page load
var query = from p in db.Products
select new { p.ProductID, p.ProductName, p.QuantityPerUnit, p.SupplierID };
GridView1.DataSource = query;
GridView1.DataBind();
thanking You All
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Linq To Sql Class
Dec 18, 2012 04:45 AM|LINK
Hi,
If your problem is solved, I'll mark yours as an answer to close this thread.
And if there's anything urgent, please freely feedback by creating another new thread.
Reguards!