Showing posts with label project. Show all posts
Showing posts with label project. Show all posts

Saturday, March 31, 2012

TableAdapter Configuration Wizard

Hey

I am trying to get some practice on VS 2005 TableAdapter Configuration
Wizard. I wrote a Database project and include a couple of stored procedures
one of which was an insert procedure. The insert procedure obviously accepts
a few parameters (the values to insert).
I have a problem creating the connection in the TableAdapter Configuration
Wizard for the insert procedure. Basically I cannot map the parameters to the
database table columns where the value was to be inserted.
Can someone please point in the direction of a good tutorial that
demonstreates the creation and use of the TableAdapter Configuration Wizard.
I read something in 15seconds.com: http://www.15seconds.com/issue/050728.htm.
So if you have something other than this, It'd be deeply appreciated.

Thanks
HectorHi Hector:

Here are a couple to look at:

http://weblogs.asp.net/scottgu/arch.../15/435498.aspx
http://msdn.microsoft.com/vbasic/de...bleadapters.asp

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Sat, 4 Feb 2006 18:34:27 -0800, "hecsan07" <hecsan07@.hotmail.com>
wrote:

>Hey
>I am trying to get some practice on VS 2005 TableAdapter Configuration
>Wizard. I wrote a Database project and include a couple of stored procedures
>one of which was an insert procedure. The insert procedure obviously accepts
>a few parameters (the values to insert).
>I have a problem creating the connection in the TableAdapter Configuration
>Wizard for the insert procedure. Basically I cannot map the parameters to the
>database table columns where the value was to be inserted.
>Can someone please point in the direction of a good tutorial that
>demonstreates the creation and use of the TableAdapter Configuration Wizard.
>I read something in 15seconds.com: http://www.15seconds.com/issue/050728.htm.
>So if you have something other than this, It'd be deeply appreciated.
>Thanks
>Hector

TableAdapter Configuration Wizard

Hey
I am trying to get some practice on VS 2005 TableAdapter Configuration
Wizard. I wrote a Database project and include a couple of stored procedures
one of which was an insert procedure. The insert procedure obviously accepts
a few parameters (the values to insert).
I have a problem creating the connection in the TableAdapter Configuration
Wizard for the insert procedure. Basically I cannot map the parameters to th
e
database table columns where the value was to be inserted.
Can someone please point in the direction of a good tutorial that
demonstreates the creation and use of the TableAdapter Configuration Wizard.
I read something in 15seconds.com: [url]http://www.15seconds.com/issue/050728.htm.[/url
]
So if you have something other than this, It'd be deeply appreciated.
Thanks
HectorHi Hector:
Here are a couple to look at:
http://weblogs.asp.net/scottgu/arch.../15/435498.aspx
http://msdn.microsoft.com/vbasic/de...
eadapters.asp
Scott
http://www.OdeToCode.com/blogs/scott/
On Sat, 4 Feb 2006 18:34:27 -0800, "hecsan07" <hecsan07@.hotmail.com>
wrote:

>Hey
>I am trying to get some practice on VS 2005 TableAdapter Configuration
>Wizard. I wrote a Database project and include a couple of stored procedure
s
>one of which was an insert procedure. The insert procedure obviously accept
s
>a few parameters (the values to insert).
>I have a problem creating the connection in the TableAdapter Configuration
>Wizard for the insert procedure. Basically I cannot map the parameters to t
he
>database table columns where the value was to be inserted.
>Can someone please point in the direction of a good tutorial that
>demonstreates the creation and use of the TableAdapter Configuration Wizard
.
>I read something in 15seconds.com: [url]http://www.15seconds.com/issue/050728.htm.[/ur
l]
>So if you have something other than this, It'd be deeply appreciated.
>Thanks
>Hector

Monday, March 26, 2012

Tables from web Matrix project to hosting provider

I've delevoped some tables as part of my web using the Web Matrix (ver 0.6) and SQL Server.
My question is how do I transfer the tables developed in the 'Data' tab to my web host.
There appears no obvious procedure?
Any info appreciated!Hello, what u need to do is use DTS, which comes with the SQL Server client tools. This tool will sort of back up ur data to transfer ur database to the server.

tabs galore

Hey all,
I'm currently working on an asp.net 2.0 project that has many tabs on the
home page. Behind the scenes seems like a nightmare to manage because all the
tabs represented on the home page is a View control inside a MultiView
control (wow, i know). Well I need to add an extra tab to this and i'm afraid
to touch this thing.

does anyone know a good a way to abstract this new tab away from the
confusion cloud?

thanks,
rodchar"rodchar" <rodchar@.discussions.microsoft.comwrote in message
news:C34A1FC3-BECD-4613-B4EF-4E8468E89FC1@.microsoft.com...

Quote:

Originally Posted by

does anyone know a good a way to abstract this new tab away from the
confusion cloud?


Is this not all set up in the markup, then...?
Hi Mark,
I'm not sure I understand your reply, please forgive me. Could you please
elaborate a little.
Rodchar

"Mark Rae" wrote:

Quote:

Originally Posted by

"rodchar" <rodchar@.discussions.microsoft.comwrote in message
news:C34A1FC3-BECD-4613-B4EF-4E8468E89FC1@.microsoft.com...
>

Quote:

Originally Posted by

does anyone know a good a way to abstract this new tab away from the
confusion cloud?


>
Is this not all set up in the markup, then...?
>
>
>


"rodchar" <rodchar@.discussions.microsoft.comwrote in message
news:22125D9D-EE5A-4B36-A76A-DFEE1C5626F1@.microsoft.com...

Quote:

Originally Posted by

I'm not sure I understand your reply, please forgive me. Could you please
elaborate a little.


You mentioned that the tabs were set up using a MultiView control and a lot
of View controls - I was asking if this was done in the markup as opposed to
being dynamically created in code-behind...

Does it not resemble something like this:?
http://www.codeproject.com/aspnet/TabControl.asp
If so, is it not simply a question of adding another <asp:Viewcontrol
wherever you need the new tab to appear...?
yeah that's very true however, what i was wondering is with the basic View
control in place for the new tab could i take the guts of the new tab and
somehow extract it out into another page or user control, or better
suggestions?

"Mark Rae" wrote:

Quote:

Originally Posted by

"rodchar" <rodchar@.discussions.microsoft.comwrote in message
news:22125D9D-EE5A-4B36-A76A-DFEE1C5626F1@.microsoft.com...
>

Quote:

Originally Posted by

I'm not sure I understand your reply, please forgive me. Could you please
elaborate a little.


>
You mentioned that the tabs were set up using a MultiView control and a lot
of View controls - I was asking if this was done in the markup as opposed to
being dynamically created in code-behind...
>
Does it not resemble something like this:?
http://www.codeproject.com/aspnet/TabControl.asp
>
If so, is it not simply a question of adding another <asp:Viewcontrol
wherever you need the new tab to appear...?
>
>
>


"rodchar" <rodchar@.discussions.microsoft.comwrote in message
news:1F19E9BB-F448-42CE-90CD-695E33A589C6@.microsoft.com...

Quote:

Originally Posted by

yeah that's very true however, what i was wondering is with the basic View
control in place for the new tab could i take the guts of the new tab and
somehow extract it out into another page or user control, or better
suggestions?


Er, well an <asp:Viewis just a container for other controls, so there's
really nothing to stop you doing anything you want with them...

I'm really not seeing what the problem is here...
i guess i just didn't want to have to go and add new code to the existing
code behind page because it is a huge code behind.

"Mark Rae" wrote:

Quote:

Originally Posted by

"rodchar" <rodchar@.discussions.microsoft.comwrote in message
news:1F19E9BB-F448-42CE-90CD-695E33A589C6@.microsoft.com...
>

Quote:

Originally Posted by

yeah that's very true however, what i was wondering is with the basic View
control in place for the new tab could i take the guts of the new tab and
somehow extract it out into another page or user control, or better
suggestions?


>
Er, well an <asp:Viewis just a container for other controls, so there's
really nothing to stop you doing anything you want with them...
>
I'm really not seeing what the problem is here...
>
>
>


"rodchar" <rodchar@.discussions.microsoft.comwrote in message
news:D3C0B6A4-CAA7-429E-98CC-0AE762D71435@.microsoft.com...

Quote:

Originally Posted by

>i guess i just didn't want to have to go and add new code to the existing
code behind page because it is a huge code behind.


OK - here's what to do...

1) In Project Explorer, highlight the file in question.

2) Type Ctrl-C

3) Type Ctrl-V

You really will be OK... :-)

tabs galore

Hey all,
I'm currently working on an asp.net 2.0 project that has many tabs on the
home page. Behind the scenes seems like a nightmare to manage because all th
e
tabs represented on the home page is a View control inside a MultiView
control (wow, i know). Well I need to add an extra tab to this and i'm afrai
d
to touch this thing.
does anyone know a good a way to abstract this new tab away from the
confusion cloud?
thanks,
rodchar"rodchar" <rodchar@.discussions.microsoft.com> wrote in message
news:C34A1FC3-BECD-4613-B4EF-4E8468E89FC1@.microsoft.com...

> does anyone know a good a way to abstract this new tab away from the
> confusion cloud?
Is this not all set up in the markup, then...?
Hi Mark,
I'm not sure I understand your reply, please forgive me. Could you please
elaborate a little.
Rodchar
"Mark Rae" wrote:

> "rodchar" <rodchar@.discussions.microsoft.com> wrote in message
> news:C34A1FC3-BECD-4613-B4EF-4E8468E89FC1@.microsoft.com...
>
> Is this not all set up in the markup, then...?
>
>
"rodchar" <rodchar@.discussions.microsoft.com> wrote in message
news:22125D9D-EE5A-4B36-A76A-DFEE1C5626F1@.microsoft.com...

> I'm not sure I understand your reply, please forgive me. Could you please
> elaborate a little.
You mentioned that the tabs were set up using a MultiView control and a lot
of View controls - I was asking if this was done in the markup as opposed to
being dynamically created in code-behind...
Does it not resemble something like this:?
http://www.codeproject.com/aspnet/TabControl.asp
If so, is it not simply a question of adding another <asp:View> control
wherever you need the new tab to appear...?
yeah that's very true however, what i was wondering is with the basic View
control in place for the new tab could i take the guts of the new tab and
somehow extract it out into another page or user control, or better
suggestions?
"Mark Rae" wrote:

> "rodchar" <rodchar@.discussions.microsoft.com> wrote in message
> news:22125D9D-EE5A-4B36-A76A-DFEE1C5626F1@.microsoft.com...
>
> You mentioned that the tabs were set up using a MultiView control and a lo
t
> of View controls - I was asking if this was done in the markup as opposed
to
> being dynamically created in code-behind...
> Does it not resemble something like this:?
> http://www.codeproject.com/aspnet/TabControl.asp
> If so, is it not simply a question of adding another <asp:View> control
> wherever you need the new tab to appear...?
>
>
"rodchar" <rodchar@.discussions.microsoft.com> wrote in message
news:1F19E9BB-F448-42CE-90CD-695E33A589C6@.microsoft.com...

> yeah that's very true however, what i was wondering is with the basic View
> control in place for the new tab could i take the guts of the new tab and
> somehow extract it out into another page or user control, or better
> suggestions?
Er, well an <asp:View> is just a container for other controls, so there's
really nothing to stop you doing anything you want with them...
I'm really not seeing what the problem is here...
i guess i just didn't want to have to go and add new code to the existing
code behind page because it is a huge code behind.
"Mark Rae" wrote:

> "rodchar" <rodchar@.discussions.microsoft.com> wrote in message
> news:1F19E9BB-F448-42CE-90CD-695E33A589C6@.microsoft.com...
>
> Er, well an <asp:View> is just a container for other controls, so there's
> really nothing to stop you doing anything you want with them...
> I'm really not seeing what the problem is here...
>
>
"rodchar" <rodchar@.discussions.microsoft.com> wrote in message
news:D3C0B6A4-CAA7-429E-98CC-0AE762D71435@.microsoft.com...

>i guess i just didn't want to have to go and add new code to the existing
> code behind page because it is a huge code behind.
OK - here's what to do...
1) In Project Explorer, highlight the file in question.
2) Type Ctrl-C
3) Type Ctrl-V
You really will be OK... :-)

Thursday, March 22, 2012

Takes forever to create a new project

Hi;
On my home computer (work computer is fine), when I create a new ASP .NET
project, it takes minutes (no exageration) for it to create the project. It
is paused forever on a dialog that says something like connectiong to
localhost/project.
And when I start the debugger, it takes about 20 seconds for the page to
come up.
For non-ASP C# apps everything is very fast. This only happens with ASP .NET
.
Any ideas?
thanks - daveDavid Thielen wrote:
> Hi;
> On my home computer (work computer is fine), when I create a new ASP
.NET
> project, it takes minutes (no exageration) for it to create the
project. It
> is paused forever on a dialog that says something like connectiong to

> localhost/project.
> And when I start the debugger, it takes about 20 seconds for the page
to
> come up.
> For non-ASP C# apps everything is very fast. This only happens with
ASP .NET.
> Any ideas?
How much RAM do you have?
1 Gig RAM - 2.? GHz hyper-threaded processor Dell Dimension.
Everything else I do on my machine is real fast.
thanks - dave
"Aquila Deus" wrote:

> David Thielen wrote:
> ..NET
> project. It
>
> to
> ASP .NET.
> How much RAM do you have?
>
The debugger launch time seems typical - but creating a new project
should be a lot quicker. Would you have any antivirus software or
firewall software running? If so, you might want to disable them
temporarily while creating a project to see if there is an impact.
Scott
http://www.OdeToCode.com/blogs/scott/
On Sat, 12 Feb 2005 21:57:02 -0800, "David Thielen"
<thielen@.nospam.nospam> wrote:
>1 Gig RAM - 2.? GHz hyper-threaded processor Dell Dimension.
>Everything else I do on my machine is real fast.
>thanks - dave
>
>"Aquila Deus" wrote:
>
David Thielen wrote:
> 1 Gig RAM - 2.? GHz hyper-threaded processor Dell Dimension.
> Everything else I do on my machine is real fast.
> thanks - dave
Weird. Was the disk light lightening during the time you wait? Is your
IIS service always running? Is it still slow if you launch debugger or
create a new project repeatedly within a few minutes?
>
> "Aquila Deus" wrote:
>
ASP
connectiong to
page
with
It doesn't seem to blink much. And at work the same program it's fast, both
creating and starting asp .net apps. It's just my home system that's slow.
- dave
"Aquila Deus" wrote:

> David Thielen wrote:
> Weird. Was the disk light lightening during the time you wait? Is your
> IIS service always running? Is it still slow if you launch debugger or
> create a new project repeatedly within a few minutes?
>
> ASP
> connectiong to
> page
> with
>
David Thielen wrote:
> It doesn't seem to blink much. And at work the same program it's
fast, both
> creating and starting asp .net apps. It's just my home system that's
slow.
then it may be waiting for something broken...
There are several general methods to solve similiar issues:
1.Open task manager to see if there is any program that uses 50+ CPU
resource
2.Launch the debugger and create new projects repeatedly to see if it's
the same slow.
3.Check your event logs, (run eventvwr.msc)
4.Don't use VS.NET :-)

Takes forever to create a new project

Hi;

On my home computer (work computer is fine), when I create a new ASP .NET
project, it takes minutes (no exageration) for it to create the project. It
is paused forever on a dialog that says something like connectiong to
localhost/project.

And when I start the debugger, it takes about 20 seconds for the page to
come up.

For non-ASP C# apps everything is very fast. This only happens with ASP .NET.

Any ideas?

--
thanks - daveDavid Thielen wrote:
> Hi;
> On my home computer (work computer is fine), when I create a new ASP
..NET
> project, it takes minutes (no exageration) for it to create the
project. It
> is paused forever on a dialog that says something like connectiong to

> localhost/project.
> And when I start the debugger, it takes about 20 seconds for the page
to
> come up.
> For non-ASP C# apps everything is very fast. This only happens with
ASP .NET.
> Any ideas?

How much RAM do you have?
1 Gig RAM - 2.? GHz hyper-threaded processor Dell Dimension.

Everything else I do on my machine is real fast.

thanks - dave

"Aquila Deus" wrote:

> David Thielen wrote:
> > Hi;
> > On my home computer (work computer is fine), when I create a new ASP
> ..NET
> > project, it takes minutes (no exageration) for it to create the
> project. It
> > is paused forever on a dialog that says something like connectiong to
> > localhost/project.
> > And when I start the debugger, it takes about 20 seconds for the page
> to
> > come up.
> > For non-ASP C# apps everything is very fast. This only happens with
> ASP .NET.
> > Any ideas?
> How much RAM do you have?
>
The debugger launch time seems typical - but creating a new project
should be a lot quicker. Would you have any antivirus software or
firewall software running? If so, you might want to disable them
temporarily while creating a project to see if there is an impact.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Sat, 12 Feb 2005 21:57:02 -0800, "David Thielen"
<thielen@.nospam.nospam> wrote:

>1 Gig RAM - 2.? GHz hyper-threaded processor Dell Dimension.
>Everything else I do on my machine is real fast.
>thanks - dave
>
>"Aquila Deus" wrote:
>> David Thielen wrote:
>> > Hi;
>>> > On my home computer (work computer is fine), when I create a new ASP
>> ..NET
>> > project, it takes minutes (no exageration) for it to create the
>> project. It
>> > is paused forever on a dialog that says something like connectiong to
>>
>> > localhost/project.
>>> > And when I start the debugger, it takes about 20 seconds for the page
>> to
>> > come up.
>>> > For non-ASP C# apps everything is very fast. This only happens with
>> ASP .NET.
>>> > Any ideas?
>>
>> How much RAM do you have?
>>
>
David Thielen wrote:
> 1 Gig RAM - 2.? GHz hyper-threaded processor Dell Dimension.
> Everything else I do on my machine is real fast.
> thanks - dave

Weird. Was the disk light lightening during the time you wait? Is your
IIS service always running? Is it still slow if you launch debugger or
create a new project repeatedly within a few minutes?

>
> "Aquila Deus" wrote:
> > David Thielen wrote:
> > > Hi;
> > > > On my home computer (work computer is fine), when I create a new
ASP
> > ..NET
> > > project, it takes minutes (no exageration) for it to create the
> > project. It
> > > is paused forever on a dialog that says something like
connectiong to
> > > localhost/project.
> > > > And when I start the debugger, it takes about 20 seconds for the
page
> > to
> > > come up.
> > > > For non-ASP C# apps everything is very fast. This only happens
with
> > ASP .NET.
> > > > Any ideas?
> > How much RAM do you have?
It doesn't seem to blink much. And at work the same program it's fast, both
creating and starting asp .net apps. It's just my home system that's slow.

- dave

"Aquila Deus" wrote:

> David Thielen wrote:
> > 1 Gig RAM - 2.? GHz hyper-threaded processor Dell Dimension.
> > Everything else I do on my machine is real fast.
> > thanks - dave
> Weird. Was the disk light lightening during the time you wait? Is your
> IIS service always running? Is it still slow if you launch debugger or
> create a new project repeatedly within a few minutes?
> > "Aquila Deus" wrote:
> > > David Thielen wrote:
> > > > Hi;
> > > > > > On my home computer (work computer is fine), when I create a new
> ASP
> > > ..NET
> > > > project, it takes minutes (no exageration) for it to create the
> > > project. It
> > > > is paused forever on a dialog that says something like
> connectiong to
> > > > > localhost/project.
> > > > > > And when I start the debugger, it takes about 20 seconds for the
> page
> > > to
> > > > come up.
> > > > > > For non-ASP C# apps everything is very fast. This only happens
> with
> > > ASP .NET.
> > > > > > Any ideas?
> > > > How much RAM do you have?
> > >
David Thielen wrote:
> It doesn't seem to blink much. And at work the same program it's
fast, both
> creating and starting asp .net apps. It's just my home system that's
slow.

then it may be waiting for something broken...

There are several general methods to solve similiar issues:

1.Open task manager to see if there is any program that uses 50+ CPU
resource
2.Launch the debugger and create new projects repeatedly to see if it's
the same slow.
3.Check your event logs, (run eventvwr.msc)
4.Don't use VS.NET :-)

Taking over project

Anyone got any pointers on taking over code from another consultant? I have
some ASP.NET code, some assemblies with the projects to build the dlls in
the bin folder, and all the code and pages that are on the production
server. Now I am going to have to set up the development environment. This
does not look as simple as opening the project in VS.NET or is it?Hi Ron,

You might find it faster to create your own project in VS.NET and start
dropping the other person's .aspx and .vb files in it. See if you can get it
to build before you make any changes.

Although you can sometimes open someone else's solution or project, there
are usually path changes and Web site configuration setting that don't match
up. You spend more time trying to make it work than you would creating your
own project and copying the files.

Ken

"Ron Weldy" <ronweldy@.msn.com> wrote in message
news:%23xM8XvKAFHA.2552@.TK2MSFTNGP09.phx.gbl...
> Anyone got any pointers on taking over code from another consultant? I
> have some ASP.NET code, some assemblies with the projects to build the
> dlls in the bin folder, and all the code and pages that are on the
> production server. Now I am going to have to set up the development
> environment. This does not look as simple as opening the project in VS.NET
> or is it?
Good point. Thanks!

"Ken Cox [Microsoft MVP]" <BANSPAMken_cox@.sympatico.ca> wrote in message
news:u1skl0KAFHA.1400@.TK2MSFTNGP11.phx.gbl...
> Hi Ron,
> You might find it faster to create your own project in VS.NET and start
> dropping the other person's .aspx and .vb files in it. See if you can get
> it to build before you make any changes.
> Although you can sometimes open someone else's solution or project, there
> are usually path changes and Web site configuration setting that don't
> match up. You spend more time trying to make it work than you would
> creating your own project and copying the files.
> Ken
> "Ron Weldy" <ronweldy@.msn.com> wrote in message
> news:%23xM8XvKAFHA.2552@.TK2MSFTNGP09.phx.gbl...
>> Anyone got any pointers on taking over code from another consultant? I
>> have some ASP.NET code, some assemblies with the projects to build the
>> dlls in the bin folder, and all the code and pages that are on the
>> production server. Now I am going to have to set up the development
>> environment. This does not look as simple as opening the project in
>> VS.NET or is it?
>

Taking over project

Anyone got any pointers on taking over code from another consultant? I have
some ASP.NET code, some assemblies with the projects to build the dlls in
the bin folder, and all the code and pages that are on the production
server. Now I am going to have to set up the development environment. This
does not look as simple as opening the project in VS.NET or is it?Hi Ron,
You might find it faster to create your own project in VS.NET and start
dropping the other person's .aspx and .vb files in it. See if you can get it
to build before you make any changes.
Although you can sometimes open someone else's solution or project, there
are usually path changes and Web site configuration setting that don't match
up. You spend more time trying to make it work than you would creating your
own project and copying the files.
Ken
"Ron Weldy" <ronweldy@.msn.com> wrote in message
news:%23xM8XvKAFHA.2552@.TK2MSFTNGP09.phx.gbl...
> Anyone got any pointers on taking over code from another consultant? I
> have some ASP.NET code, some assemblies with the projects to build the
> dlls in the bin folder, and all the code and pages that are on the
> production server. Now I am going to have to set up the development
> environment. This does not look as simple as opening the project in VS.NET
> or is it?
>
Good point. Thanks!
"Ken Cox [Microsoft MVP]" <BANSPAMken_cox@.sympatico.ca> wrote in message
news:u1skl0KAFHA.1400@.TK2MSFTNGP11.phx.gbl...
> Hi Ron,
> You might find it faster to create your own project in VS.NET and start
> dropping the other person's .aspx and .vb files in it. See if you can get
> it to build before you make any changes.
> Although you can sometimes open someone else's solution or project, there
> are usually path changes and Web site configuration setting that don't
> match up. You spend more time trying to make it work than you would
> creating your own project and copying the files.
> Ken
> "Ron Weldy" <ronweldy@.msn.com> wrote in message
> news:%23xM8XvKAFHA.2552@.TK2MSFTNGP09.phx.gbl...
>

Tuesday, March 13, 2012

Targeting a database path that is outside of the current project?

Well, good thing that the forum stated "No question too simple" because I'm sure this is uber basic...Embarrassed

I have a working Default.aspx page that accesses a database (hsDatabase.mdf) within the App_Data folder. Just the basic ASP website structure automatically made by Visual Web Developer 2005 Express Edition.

The page works fine on the local computer.

The problem is, when I put it up on my server on the web, the server requires all databases to be put in a specific "database" folder which is up a level from the html folder where I put my ASP and HTML files. That is, it's outside of the project folder.

And try as I might, I can't seem to get the Default.aspx page to connect with database when it's not residing in a folder called "App_Data" which is at the same level as the ASP file.

I assume that the key lies in how I write the connectionstring in the web.config file?

This is the connectionstring that works on my computer:
connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\hsDatabase.mdf;Integrated Security=True;User Instance=True"

But instead of|DataDirectory|\hsDatabase.mdf, I wish I could just put write a hardcoded address like www.mySite.com/database/hsDatabase.mdf.
Or at least a relative path that worked like../../database/hsDatabase.mdf

How can I connect to a database that's outside of my project folder, or anywhere on the web for that matter?


Thanks everyone!


Hopefully this helps -

Imports System.Data.SqlClientImports System.IOImports System.Web.ConfigurationPartialClass DefaultInherits System.Web.UI.PageProtected Sub Page_Load(ByVal senderAs Object,ByVal eAs System.EventArgs)Handles Me.LoadDim bldrAs New SqlConnectionStringBuilder(WebConfigurationManager.ConnectionStrings("connectionStringName").ConnectionString) bldr.AttachDBFilename = Path.GetFullPath("/otherDir/hsDatabase.mdf")' output modified connection string Response.Write(bldr.ConnectionString &"<hr/>")End SubEnd Class

Well, that's a bit more complicated that I thought it would be! Definitely a change from the old ASP style of doing it.

The outputted modified connection string (bldr.ConnectionString),should I be putting that result into my Default.aspx page or my web.config page? And how do I pass that variable from this .aspx.vb page into the correct page?

BTW... the connection code for the Default.aspx page is: <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"

while the web.config page is: <connectionStrings>
<add name="ConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\hsDatabase.mdf;Integrated Security=True;User Instance=True"
providerName="System.Data.SqlClient" />
</connectionStrings>

Thank you so much again!


Hi robchis,

My suggestion could be wrong,so please correct me if you find any mistakes within my suggestion.Based on my understanding and experience,I think of course you can access the database which is outside of your website root directory. I used to access a sql database which is hosted by another server machine from my website and it works fine. The point is, make sure that the data server has sql-server serverside installed with service correctlly configured and started, then within you website, you can click the "configure Data Source" from you sqldatasource control and input the right sql-server server name and choose the right database.After that you will be able to access the database in your site.

For more and detailed information, please refer to:

http://msdn2.microsoft.com/en-us/library/ms178361.aspx

http://dotnetjunkies.com/QuickStartv20/aspnet/doc/data/databases.aspx

targetSchema gets reset

Following MS' recommendation, I have changed the targetNamespace of my
dataset in its .XSD file in a project I am (still) developing from the
default http://www.tempuri.org to something of mine, i.e. changed the line:
<xs:schema id="DataSetIC"
targetNamespace="http://www.tempuri.org/DataSetIC.xsd"
xmlns:mstns="http://www.tempuri.org/DataSetIC.xsd"
xmlns="http://www.tempuri.org/DataSetIC.xsd" ...>
Now, every time I change the database and ask Visual Studio .NET to
regenerate the dataset, it chucks away my changes and resets to
www.tempuri.org, which then fouls my integrations with the dataset.
Is there any way I can get VS .NET to retain my target namespace change?I too wish someone could explain this annoying problem, along with the
fact that (re)generating dataset for a dataadapter also throws away the
keys I defined in the DataSet
jb wrote:
> Following MS' recommendation, I have changed the targetNamespace of my
> dataset in its .XSD file in a project I am (still) developing from the
> default http://www.tempuri.org to something of mine, i.e. changed the line
:
> <xs:schema id="DataSetIC"
> targetNamespace="http://www.tempuri.org/DataSetIC.xsd"
> xmlns:mstns="http://www.tempuri.org/DataSetIC.xsd"
> xmlns="http://www.tempuri.org/DataSetIC.xsd" ...>
> Now, every time I change the database and ask Visual Studio .NET to
> regenerate the dataset, it chucks away my changes and resets to
> www.tempuri.org, which then fouls my integrations with the dataset.
> Is there any way I can get VS .NET to retain my target namespace change?
>
Uri,
That's very interesting. Because I have another post elsewhere
(http://communities2.microsoft.com/c...rk.aspnet&fltr=)
which is inspired by *just* what you say. I have suddenly noticed that in
the XSD I had manually defined a unique constraint on behalf of a unique (bu
t
not primary) key I had in my SQL and it gets removed when I regenerate.
Isn't that exactly what you're talking about? I'm tryinjg to find an articl
e
which describes precisely whatever it is that the (re-)generator does or doe
s
not do, so that I can take this into account -- any ideas?
"Uri Dor" wrote:

> I too wish someone could explain this annoying problem, along with the
> fact that (re)generating dataset for a dataadapter also throws away the
> keys I defined in the DataSet
> jb wrote:
>
Uri,
That's very interesting. Because I have another post elsewhere
(http://communities2.microsoft.com/c...rk.aspnet&fltr=)
which is inspired by *just* what you say. I have suddenly noticed that in
the XSD I had manually defined a unique constraint on behalf of a unique (bu
t
not primary) key I had in my SQL and it gets removed when I regenerate.
Isn't that exactly what you're talking about? I'm tryinjg to find an articl
e
which describes precisely whatever it is that the (re-)generator does or doe
s
not do, so that I can take this into account -- any ideas?
"Uri Dor" wrote:

> I too wish someone could explain this annoying problem, along with the
> fact that (re)generating dataset for a dataadapter also throws away the
> keys I defined in the DataSet
> jb wrote:
>
I believe we're talking about the same thing. Regarding the article -
haven't seen such an article yet.
jb wrote:
> Uri,
> That's very interesting. Because I have another post elsewhere
> (http://communities2.microsoft.com/c...rk.aspnet&fltr=)
> which is inspired by *just* what you say. I have suddenly noticed that in
> the XSD I had manually defined a unique constraint on behalf of a unique (
but
> not primary) key I had in my SQL and it gets removed when I regenerate.
> Isn't that exactly what you're talking about? I'm tryinjg to find an arti
cle
> which describes precisely whatever it is that the (re-)generator does or d
oes
> not do, so that I can take this into account -- any ideas?
> "Uri Dor" wrote:
>

targetSchema gets reset

Following MS' recommendation, I have changed the targetNamespace of my
dataset in its .XSD file in a project I am (still) developing from the
default http://www.tempuri.org to something of mine, i.e. changed the line:

<xs:schema id="DataSetIC"
targetNamespace="http://www.tempuri.org/DataSetIC.xsd"
xmlns:mstns="http://www.tempuri.org/DataSetIC.xsd"
xmlns="http://www.tempuri.org/DataSetIC.xsd" ...
Now, every time I change the database and ask Visual Studio .NET to
regenerate the dataset, it chucks away my changes and resets to
www.tempuri.org, which then fouls my integrations with the dataset.

Is there any way I can get VS .NET to retain my target namespace change?I too wish someone could explain this annoying problem, along with the
fact that (re)generating dataset for a dataadapter also throws away the
keys I defined in the DataSet

jb wrote:
> Following MS' recommendation, I have changed the targetNamespace of my
> dataset in its .XSD file in a project I am (still) developing from the
> default http://www.tempuri.org to something of mine, i.e. changed the line:
> <xs:schema id="DataSetIC"
> targetNamespace="http://www.tempuri.org/DataSetIC.xsd"
> xmlns:mstns="http://www.tempuri.org/DataSetIC.xsd"
> xmlns="http://www.tempuri.org/DataSetIC.xsd" ...>
> Now, every time I change the database and ask Visual Studio .NET to
> regenerate the dataset, it chucks away my changes and resets to
> www.tempuri.org, which then fouls my integrations with the dataset.
> Is there any way I can get VS .NET to retain my target namespace change?
Uri,

That's very interesting. Because I have another post elsewhere
(http://communities2.microsoft.com/c...rk.aspnet&fltr=)
which is inspired by *just* what you say. I have suddenly noticed that in
the XSD I had manually defined a unique constraint on behalf of a unique (but
not primary) key I had in my SQL and it gets removed when I regenerate.
Isn't that exactly what you're talking about? I'm tryinjg to find an article
which describes precisely whatever it is that the (re-)generator does or does
not do, so that I can take this into account -- any ideas?

"Uri Dor" wrote:

> I too wish someone could explain this annoying problem, along with the
> fact that (re)generating dataset for a dataadapter also throws away the
> keys I defined in the DataSet
> jb wrote:
> > Following MS' recommendation, I have changed the targetNamespace of my
> > dataset in its .XSD file in a project I am (still) developing from the
> > default http://www.tempuri.org to something of mine, i.e. changed the line:
> > <xs:schema id="DataSetIC"
> > targetNamespace="http://www.tempuri.org/DataSetIC.xsd"
> > xmlns:mstns="http://www.tempuri.org/DataSetIC.xsd"
> > xmlns="http://www.tempuri.org/DataSetIC.xsd" ...>
> > Now, every time I change the database and ask Visual Studio .NET to
> > regenerate the dataset, it chucks away my changes and resets to
> > www.tempuri.org, which then fouls my integrations with the dataset.
> > Is there any way I can get VS .NET to retain my target namespace change?
Uri,

That's very interesting. Because I have another post elsewhere
(http://communities2.microsoft.com/c...rk.aspnet&fltr=)
which is inspired by *just* what you say. I have suddenly noticed that in
the XSD I had manually defined a unique constraint on behalf of a unique (but
not primary) key I had in my SQL and it gets removed when I regenerate.
Isn't that exactly what you're talking about? I'm tryinjg to find an article
which describes precisely whatever it is that the (re-)generator does or does
not do, so that I can take this into account -- any ideas?

"Uri Dor" wrote:

> I too wish someone could explain this annoying problem, along with the
> fact that (re)generating dataset for a dataadapter also throws away the
> keys I defined in the DataSet
> jb wrote:
> > Following MS' recommendation, I have changed the targetNamespace of my
> > dataset in its .XSD file in a project I am (still) developing from the
> > default http://www.tempuri.org to something of mine, i.e. changed the line:
> > <xs:schema id="DataSetIC"
> > targetNamespace="http://www.tempuri.org/DataSetIC.xsd"
> > xmlns:mstns="http://www.tempuri.org/DataSetIC.xsd"
> > xmlns="http://www.tempuri.org/DataSetIC.xsd" ...>
> > Now, every time I change the database and ask Visual Studio .NET to
> > regenerate the dataset, it chucks away my changes and resets to
> > www.tempuri.org, which then fouls my integrations with the dataset.
> > Is there any way I can get VS .NET to retain my target namespace change?
I believe we're talking about the same thing. Regarding the article -
haven't seen such an article yet.

jb wrote:

> Uri,
> That's very interesting. Because I have another post elsewhere
> (http://communities2.microsoft.com/c...rk.aspnet&fltr=)
> which is inspired by *just* what you say. I have suddenly noticed that in
> the XSD I had manually defined a unique constraint on behalf of a unique (but
> not primary) key I had in my SQL and it gets removed when I regenerate.
> Isn't that exactly what you're talking about? I'm tryinjg to find an article
> which describes precisely whatever it is that the (re-)generator does or does
> not do, so that I can take this into account -- any ideas?
> "Uri Dor" wrote:
>
>>I too wish someone could explain this annoying problem, along with the
>>fact that (re)generating dataset for a dataadapter also throws away the
>>keys I defined in the DataSet
>>
>>jb wrote:
>>
>>>Following MS' recommendation, I have changed the targetNamespace of my
>>>dataset in its .XSD file in a project I am (still) developing from the
>>>default http://www.tempuri.org to something of mine, i.e. changed the line:
>>>
>>> <xs:schema id="DataSetIC"
>>>targetNamespace="http://www.tempuri.org/DataSetIC.xsd"
>>>xmlns:mstns="http://www.tempuri.org/DataSetIC.xsd"
>>>xmlns="http://www.tempuri.org/DataSetIC.xsd" ...>
>>>
>>>Now, every time I change the database and ask Visual Studio .NET to
>>>regenerate the dataset, it chucks away my changes and resets to
>>>www.tempuri.org, which then fouls my integrations with the dataset.
>>>
>>>Is there any way I can get VS .NET to retain my target namespace change?
>>>
>>