Linq

D

David

Hi all,

I am new to .NET 3.5, though experienced with 1.1 and most of 2.0.

My Q is about LINQ. I have been shown some of the rudimentary stuff about
linq, but not how to connect to a DB.

I have in my web.config file, a connectionstring setting. This connects to
my localhost\sqlexpress with my username/password. The way I have always
done in .net.

I have created a DBML file to start the connection to Linq. I have set the
Connection property of the DBML to "Conn (Web.config)" (without the quotes).

However, I don't have a clue as to how to get the tables from my database
onto the panel. Can someone help?

(I have tried google, but not sure what keywords I should use, so nothing is
really helping from there.)

--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
 
P

Pavel Minaev

Hi all,

I am new to .NET 3.5, though experienced with 1.1 and most of 2.0.

My Q is about LINQ. I have been shown some of the rudimentary stuff about
linq, but not how to connect to a DB.

I have in my web.config file, a connectionstring setting. This connects to
my localhost\sqlexpress with my username/password. The way I have always
done in .net.

I have created a DBML file to start the connection to Linq. I have set the
Connection property of the DBML to "Conn (Web.config)" (without the quotes).

However, I don't have a clue as to how to get the tables from my database
onto the panel. Can someone help?

I'm not sure what "panel" you're talking about. You access tables via
DataContext.GetTable<T>() method. Then you data bind them to whatever
you want, as usual.
 
R

Raphael Gomes

Hi all,

I am new to .NET 3.5, though experienced with 1.1 and most of 2.0.

My Q is about LINQ. I have been shown some of the rudimentary stuff about
linq, but not how to connect to a DB.

I have in my web.config file, a connectionstring setting. This connects to
my localhost\sqlexpress with my username/password. The way I have always
done in .net.

I have created a DBML file to start the connection to Linq. I have set the
Connection property of the DBML to "Conn (Web.config)" (without the quotes).

However, I don't have a clue as to how to get the tables from my database
onto the panel. Can someone help?

(I have tried google, but not sure what keywords I should use, so nothing is
really helping from there.)

If I understood your question, in Visual Studio you should open up the
Server Explorer Panel and create a connection to your database (right
click on it, choose add connection, etc). Once this is set, you'll see
an entry on Server Explorer named as server.database.dbo.

Open it and you'll see the tables. These tables can be dragged and
dropped onto the dbml panel.

I hope this helps,
 
D

David

Hi,

Yes, you have interpreted my question correct. Thank you for your answer.

I would have thought that when you define the database connection in the
dbml properties pane, that either the DB would appear in the servers panel
or that the right click option would allow you to select a table to drop in.

Obviously, not that smart.

So, if I have to create a new connection and put the DB in the servers pane,
when I come to put the site live and copy the dbml file over, will the dbml
now be pointing to the wrong DB or is the DB in the servers pane just to
help you build the dbml?

Thanks.
--
Best regards,
Dave Colliver.
http://www.AshfieldFOCUS.com
~~
http://www.FOCUSPortals.com - Local franchises available
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top