Showing posts with label designing. Show all posts
Showing posts with label designing. Show all posts

Thursday, March 29, 2012

HELP with connection string PLEASEEEE!

hi, I'm kind of really new to this. Trying to learn asp.net 2.0. Have been designing a website, and, so far so good, I can deploy the files, but I can't get the synthax right for the connection string. in my web.config file the connection string works on the local computer, but I can't figure out how to change the data source part:
this is what I have in my web convig file
<add name="Database2ConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename="C:\Documents and Settings\Alexi\My Documents\Delivery\web\App_Data\Database2.mdf";Integrated Security=True;Connect Timeout=30;User Instance=True"
providerName="System.Data.SqlClient" /
the the wrox book says I have to have the|datadirectory|
does it mean I have to write the full http address on the server?
and I can't figure out what to substitute in for the ".\sqlexpress" part...

my host has ms sql server 2000 and my sql. I asked for their support and the gave me a weird looking connection string and claimed that it worked...

<%@. LANGUAGE = JScript %>
<% var oConn;
oConn = Server.CreateObject("ADODB.Connection");
oConn.Mode = 3
oConn.Open("Provider=SQLOLEDB;Server=203.89.181.78;Database=alexeyka_yah_1951com_;UID=support;PWD=test123;");
%>
'

How can I, and where, copy my existing databse, and change the connection string?


Would really appreciate any help, perhaps buy a new book from the programmers in gratitude.

there is nothing wrong with connection string - the problem is that you are using database file with SQL express and you host SQL 2000 - so they will not be able to attach database file the way SQL Express does...

few days ago i posted why not to use database file with project that will go to shared hosting here:
http://forums.asp.net/thread/1375347.aspx - in the future login to SQL (express is cool) and create database then backup it and restore on your web hosting's SQL server

More info about connection strings you will find here:
http://www.connectionstrings.com/

If the database you have is empty no real data, then copy databse structure to new server change database2ConnectionString and you are good to go

your connections strin g will look like this

<add name="Database2ConnectionString" connectionString="Data Source=203.89.181.78;Initial Catalog=alexeyka_yah_1951com_;User ID=support;Password=test123;"
providerName="System.Data.SqlClient" />

BTW if that is real user pwd - CHANGE IT

|||

Hey, thank you so much for you help. Sorry for the late reply - didn't

The database does connect now, so all I have to do now is to figure out how to actually copy my database file to server.

Alexi;)

|||

if they offer SQL 2005 you should not have any problems. If not and you have to use SQL 2000 read this:

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=71448&SiteID=1

|||

Hey, thanks again.

I was able to create an identical blank database table on the server in their asp.net enterprise manager. Yes, the do only have 2000 version.

Then, in VWD express I changed datasource control to point to the connection string that connects to the db on the server - it worked.

I'm struggling to contect to the database remotely, will hopefully figure something out.

Cheers again,

Alexi

|||

" I'm struggling to contect to the database remotely " ? - IF the hosting company accepts remote connections you can use free tool like SQL Server Managment Studio Express Edition to connect and work on you database. Keep in mind that many hoster block remote connections so you can only make changes to database design via online Enterprise manager or diffrent tool. If that is the case then simply change connection string in web config when you work on this application to you local machine, and before you do upload to server change it back to real SQL (the 2000 one)

|||

Hi Tom,

Thanks for you reply. I did download the sql server management studio, and asked whether my hosts allowed the remote connection - they don't. so I guess I have to do everything from scratch on the enterprise manager online. I've figured out normal tables, my main concern now will be to generate tables to store username/password info.

Cheers once again,

Alex

|||

one solution is to script everything

or the easy way will be :) :

http://forums.commercestarterkit.org/files/folders/sql_2000_upsize_scripts/entry471.aspx

|||

you can use this tool to add/edit/ delete users, create roles

http://peterkellner.net/2006/07/17/atlasjunectpsource/

make sure you secure it on the server, so u are the only one who can access it

|||

Hi Tom,

Thanks again for you input, have been real busy populating my datatables, so haven't had time to work on logins/users. If you like, you can check out the results of your efforts atwww.takeawaydelivery.co.nz

Will now be working my way into creating loging pages. By the way, the link that you gave me for some reason, it says there was a fata error and it couldn't be viewed? Anyway, thanks for all your help, and I'll let you know if I get around to creating users/etc

|||

the one with script or the one with tool to manage users ? i chcecked both links and are working just fine for me.

|||

Hi,

Seems to be working fine now, that was the tool to manage script. Downloaded it, and ran it. Works fine on my computer, though I can't understand though where are the usernames/passwords are stored. Also, with the tables, do I just run the whole script in the enterprise manager? and how do I link the two? Thanks again,

Alexi

|||

Hi,

an update here - the admin tool works fine on the local computer. I also reconfigured the weg.config file to point towards a remote database for users/passwords:

<membershipdefaultProvider="CustomizedProvider">

<providers>

<addname="CustomizedProvider"

type="System.Web.Security.SqlMembershipProvider"

connectionStringName="MyDB"

minRequiredPasswordLength="5"

minRequiredNonalphanumericCharacters="0" />

</providers>

</membership>

(and added a corresponding connection string).

For some reason though, when I run the table building script it doesn't show that anything is happening? like tables do not appear? any ideas-

thanks

Alexi

|||

Server Error in '/' Application.

Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.Data.SqlClient.SqlException: Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'.

Source Error:

Line 50: private void FindFirstUserName()Line 51: {Line 52: MembershipUserCollection muc = Membership.GetAllUsers();Line 53: foreach (MembershipUser mu in muc)Line 54: {


Source File:c:\Inetpub\vhosts\takeawaydelivery.co.nz\httpdocs\Default.aspx.cs Line:52

Stack Trace:

this is the erro when i go to the tool|||the database script (link i sent u) i used it few times and never had any problems with it - make sure that u can see all tables needed and stored proc.

Monday, March 26, 2012

Help with Best practie and design

HI all,
I covert your input.
I am designing a claims database. I am looking at have a common claims
header table, that will keep all common thing to every claim, and then
seperate tables depending on the type/class of claim. So I could have a
motor, marine, asset for example. Reason being that there is information
that is not common between these classes, Eg. driver ID is only required for
motor, vessel name is only required for Marine etc. I don't want to have one
large claims table, with as many columns as there are different permutaions
of types of data for each claim class
My question is what is the best way to set this up. How wold I have a parent
common claims table, with say, a motor, marine, asset child table. How would
I relate these three table to the parent common claims table, because
obviously there will be rows in the parent that only have one corresponding
row in one of the other chiold tables, and never more than one corresponding
table.
Am I making this clear
THanks
RobertRobert
CREATE TABLE Parent_Claims
(
ParentId INT NOT NULL PRIMARY KEY,
ParentName VARCHAR(n) NOT NULL
....
)
CREATE TABLE Type_Claims
(
TypeId INT NOT NULL PRIMARY KEY,
TypeDescr VARCHAR(n) NOT NULL
...
)
CREATE TABLE Parent_Types
(
PT_ID INT NOT NULL PRIMARY KEY,
ParentID INT NOT NULL FOREIGN KEY REFERENCES Parent_Claims (ParentId ),
TypeId INT NOT NULL FOREIGN KEY REFERENCES Type_Claims(TypeId ),
)
Note: I don't know your business requirements hence tried to give a common
solution
"Robert Bravery" <me@.u.com> wrote in message
news:eOj7Ub6NGHA.2916@.tk2msftngp13.phx.gbl...
> HI all,
> I covert your input.
> I am designing a claims database. I am looking at have a common claims
> header table, that will keep all common thing to every claim, and then
> seperate tables depending on the type/class of claim. So I could have a
> motor, marine, asset for example. Reason being that there is information
> that is not common between these classes, Eg. driver ID is only required
> for
> motor, vessel name is only required for Marine etc. I don't want to have
> one
> large claims table, with as many columns as there are different
> permutaions
> of types of data for each claim class
> My question is what is the best way to set this up. How wold I have a
> parent
> common claims table, with say, a motor, marine, asset child table. How
> would
> I relate these three table to the parent common claims table, because
> obviously there will be rows in the parent that only have one
> corresponding
> row in one of the other chiold tables, and never more than one
> corresponding
> table.
> Am I making this clear
> THanks
> Robert
>|||Hi Uri,
Thanks
Yes I got that. But now added those two extra tables, that are not common,
how would I relate them to the commaon parent clain;
CREATE TABLE [dbo].[Marine] (
[MarineID] [int] NOT NULL ,
[VesselName] [varchar] (50) NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Motor] (
[MotorID] [int] NOT NULL ,
[DriverID] [varchar] (50) NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Parent_Claims] (
[ParentId] [int] NOT NULL ,
[ParentName] [varchar] (10) NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Type_Claims] (
[TypeId] [int] NOT NULL ,
[TypeDescr] [varchar] (10) NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[Parent_Types] (
[PT_ID] [int] NOT NULL ,
[ParentID] [int] NOT NULL ,
[TypeId] [int] NOT NULL
) ON [PRIMARY]
GO
THanks
Robert
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:#H#OXu6NGHA.208@.tk2msftngp13.phx.gbl...
> Robert
>
> CREATE TABLE Parent_Claims
> (
> ParentId INT NOT NULL PRIMARY KEY,
> ParentName VARCHAR(n) NOT NULL
> .....
> )
> CREATE TABLE Type_Claims
> (
> TypeId INT NOT NULL PRIMARY KEY,
> TypeDescr VARCHAR(n) NOT NULL
> ....
> )
> CREATE TABLE Parent_Types
> (
> PT_ID INT NOT NULL PRIMARY KEY,
> ParentID INT NOT NULL FOREIGN KEY REFERENCES Parent_Claims (ParentId ),
> TypeId INT NOT NULL FOREIGN KEY REFERENCES Type_Claims(TypeId ),
> )
>
> Note: I don't know your business requirements hence tried to give a
common
> solution
>
>
> "Robert Bravery" <me@.u.com> wrote in message
> news:eOj7Ub6NGHA.2916@.tk2msftngp13.phx.gbl...
>|||> My question is what is the best way to set this up. How wold I have a
> parent
> common claims table, with say, a motor, marine, asset child table. How
> would
> I relate these three table to the parent common claims table, because
> obviously there will be rows in the parent that only have one
> corresponding
> row in one of the other chiold tables, and never more than one
> corresponding
> table.
> Am I making this clear
create table claim (
claim_id int not null,
...
constraint [pk_claim] primary key nonclustered
(claim_id)
)
create table motor_claim (
claim_id not null,
...
constraint [pk_motor_claim] primary key nonclustered
(claim_id)
)
alter table motor_claim
add constraint [fk_blah] foreign key (claim_id)
references dbo.claim (claim_id)
This supports a 1-to-1 relationship between claim and any particular child
type table. It does NOT limit a claim to having a single row in a single
child table. For that, you would need another constrainting device (e.g.,
trigger, indexed view).|||Look up some of my old postings about "faking" class hierarchies in
SQL. Then read why this is a horrible approach to RDBMS.
Also, there is no such data element as a "type_id". An attribute can
be a *particular* kind of identifier or a *particular* kind of type.
It cannot be both and it cannot be so vague. Think about it for a
second.|||--CELKO-- wrote:
> Look up some of my old postings about "faking" class hierarchies in
> SQL. Then read why this is a horrible approach to RDBMS.
Do you mean your "CREATE TABLE Vehicles" postings? Where can I read
your critique of this approach?
Thanks,
Jamie.

Wednesday, March 21, 2012

Help with a Query

I have been designing a website for our fishing club and I need help
with one of my queries because I'm not to good at it yet.
The table has FishID, Angler, RecordDate, Species, Length, Photo for
columns.
The species can only be - Muskie, Northern, Walleye, Catfish, Crappie
What I want is display the data like this
Angler Muskie_total Northern_total Walleye_total Catfish_total
Crappie_Total Longest_fish Total_points
All species except Muskie are worth 1 point, Muskie are worth 5,
longest fish is worth 5
So it didn't take long for this to get over my head.
Anybody want to give me a hand at this, leagues start in 2 weeks!!!
Thanks,
MartyOn Apr 30, 5:52 am, Marty <mcoon...@.gmail.com> wrote:
> I have been designing a website for our fishing club and I need help
> with one of my queries because I'm not to good at it yet.
> The table has FishID, Angler, RecordDate, Species, Length, Photo for
> columns.
> The species can only be - Muskie, Northern, Walleye, Catfish, Crappie
> What I want is display the data like this
> Angler Muskie_total Northern_total Walleye_total Catfish_total
> Crappie_Total Longest_fish Total_points
> All species except Muskie are worth 1 point, Muskie are worth 5,
> longest fish is worth 5
> So it didn't take long for this to get over my head.
> Anybody want to give me a hand at this, leagues start in 2 weeks!!!
> Thanks,
> Marty
Try something on these lines
SELECT Angler ,
SUM(CASE WHEN Species = 'Muskie' THEN 5 END ) AS Muskie_total ,
SUM(CASE WHEN Species = 'Northern' THEN 1 END ) AS
Northern_total ,
SUM(CASE WHEN Species = 'Walleye' THEN 1 END ) AS Walleye_total ,
SUM(CASE WHEN Species = 'Catfish' THEN 1 END ) AS Catfish_total,
SUM(CASE WHEN Species = 'Crappie' THEN 1 END ) AS Crappie_Total ,
SUM(CASE WHEN Species = 'Longest_fish ' THEN 5 END ) AS
Longest_fish_Total
FROM Fish
Group by Angler|||On Apr 30, 12:55 am, M A Srinivas <masri...@.gmail.com> wrote:
> On Apr 30, 5:52 am,Marty<mcoon...@.gmail.com> wrote:
>
>
> > I have been designing a website for our fishing club and I need help
> > with one of my queries because I'm not to good at it yet.
> > The table has FishID, Angler, RecordDate, Species, Length, Photo for
> > columns.
> > The species can only be - Muskie, Northern, Walleye, Catfish, Crappie
> > What I want is display the data like this
> > Angler Muskie_total Northern_total Walleye_total Catfish_total
> > Crappie_Total Longest_fish Total_points
> > All species except Muskie are worth 1 point, Muskie are worth 5,
> > longest fish is worth 5
> > So it didn't take long for this to get over my head.
> > Anybody want to give me a hand at this, leagues start in 2 weeks!!!
> > Thanks,
> >Marty
> Try something on these lines
> SELECT Angler ,
> SUM(CASE WHEN Species = 'Muskie' THEN 5 END ) AS Muskie_total ,
> SUM(CASE WHEN Species = 'Northern' THEN 1 END ) AS
> Northern_total ,
> SUM(CASE WHEN Species = 'Walleye' THEN 1 END ) AS Walleye_total ,
> SUM(CASE WHEN Species = 'Catfish' THEN 1 END ) AS Catfish_total,
> SUM(CASE WHEN Species = 'Crappie' THEN 1 END ) AS Crappie_Total ,
> SUM(CASE WHEN Species = 'Longest_fish ' THEN 5 END ) AS
> Longest_fish_Total
> FROM Fish
> Group by Angler- Hide quoted text -
> - Show quoted text -
Thanks!!!sql

Monday, March 19, 2012

Help with a Query

I have been designing a website for our fishing club and I need help
with one of my queries because I'm not to good at it yet.
The table has FishID, Angler, RecordDate, Species, Length, Photo for
columns.
The species can only be - Muskie, Northern, Walleye, Catfish, Crappie
What I want is display the data like this
Angler Muskie_total Northern_total Walleye_total Catfish_total
Crappie_Total Longest_fish Total_points
All species except Muskie are worth 1 point, Muskie are worth 5,
longest fish is worth 5
So it didn't take long for this to get over my head.
Anybody want to give me a hand at this, leagues start in 2 weeks!!!
Thanks,
Marty
On Apr 30, 5:52 am, Marty <mcoon...@.gmail.com> wrote:
> I have been designing a website for our fishing club and I need help
> with one of my queries because I'm not to good at it yet.
> The table has FishID, Angler, RecordDate, Species, Length, Photo for
> columns.
> The species can only be - Muskie, Northern, Walleye, Catfish, Crappie
> What I want is display the data like this
> Angler Muskie_total Northern_total Walleye_total Catfish_total
> Crappie_Total Longest_fish Total_points
> All species except Muskie are worth 1 point, Muskie are worth 5,
> longest fish is worth 5
> So it didn't take long for this to get over my head.
> Anybody want to give me a hand at this, leagues start in 2 weeks!!!
> Thanks,
> Marty
Try something on these lines
SELECT Angler ,
SUM(CASE WHEN Species = 'Muskie' THEN 5 END ) AS Muskie_total ,
SUM(CASE WHEN Species = 'Northern' THEN 1 END ) AS
Northern_total ,
SUM(CASE WHEN Species = 'Walleye' THEN 1 END ) AS Walleye_total ,
SUM(CASE WHEN Species = 'Catfish' THEN 1 END ) AS Catfish_total,
SUM(CASE WHEN Species = 'Crappie' THEN 1 END ) AS Crappie_Total ,
SUM(CASE WHEN Species = 'Longest_fish ' THEN 5 END ) AS
Longest_fish_Total
FROM Fish
Group by Angler
|||On Apr 30, 12:55 am, M A Srinivas <masri...@.gmail.com> wrote:
> On Apr 30, 5:52 am,Marty<mcoon...@.gmail.com> wrote:
>
>
>
>
>
>
> Try something on these lines
> SELECT Angler ,
> SUM(CASE WHEN Species = 'Muskie' THEN 5 END ) AS Muskie_total ,
> SUM(CASE WHEN Species = 'Northern' THEN 1 END ) AS
> Northern_total ,
> SUM(CASE WHEN Species = 'Walleye' THEN 1 END ) AS Walleye_total ,
> SUM(CASE WHEN Species = 'Catfish' THEN 1 END ) AS Catfish_total,
> SUM(CASE WHEN Species = 'Crappie' THEN 1 END ) AS Crappie_Total ,
> SUM(CASE WHEN Species = 'Longest_fish ' THEN 5 END ) AS
> Longest_fish_Total
> FROM Fish
> Group by Angler- Hide quoted text -
> - Show quoted text -
Thanks!!!

Help with a Query

I have been designing a website for our fishing club and I need help
with one of my queries because I'm not to good at it yet.
The table has FishID, Angler, RecordDate, Species, Length, Photo for
columns.
The species can only be - Muskie, Northern, Walleye, Catfish, Crappie
What I want is display the data like this
Angler Muskie_total Northern_total Walleye_total Catfish_total
Crappie_Total Longest_fish Total_points
All species except Muskie are worth 1 point, Muskie are worth 5,
longest fish is worth 5
So it didn't take long for this to get over my head.
Anybody want to give me a hand at this, leagues start in 2 weeks!!!
Thanks,
MartyOn Apr 30, 5:52 am, Marty <mcoon...@.gmail.com> wrote:
> I have been designing a website for our fishing club and I need help
> with one of my queries because I'm not to good at it yet.
> The table has FishID, Angler, RecordDate, Species, Length, Photo for
> columns.
> The species can only be - Muskie, Northern, Walleye, Catfish, Crappie
> What I want is display the data like this
> Angler Muskie_total Northern_total Walleye_total Catfish_total
> Crappie_Total Longest_fish Total_points
> All species except Muskie are worth 1 point, Muskie are worth 5,
> longest fish is worth 5
> So it didn't take long for this to get over my head.
> Anybody want to give me a hand at this, leagues start in 2 weeks!!!
> Thanks,
> Marty
Try something on these lines
SELECT Angler ,
SUM(CASE WHEN Species = 'Muskie' THEN 5 END ) AS Muskie_total ,
SUM(CASE WHEN Species = 'Northern' THEN 1 END ) AS
Northern_total ,
SUM(CASE WHEN Species = 'Walleye' THEN 1 END ) AS Walleye_total ,
SUM(CASE WHEN Species = 'Catfish' THEN 1 END ) AS Catfish_total,
SUM(CASE WHEN Species = 'Crappie' THEN 1 END ) AS Crappie_Total ,
SUM(CASE WHEN Species = 'Longest_fish ' THEN 5 END ) AS
Longest_fish_Total
FROM Fish
Group by Angler|||On Apr 30, 12:55 am, M A Srinivas <masri...@.gmail.com> wrote:
> On Apr 30, 5:52 am,Marty<mcoon...@.gmail.com> wrote:
>
>
>
>
>
>
>
>
>
> Try something on these lines
> SELECT Angler ,
> SUM(CASE WHEN Species = 'Muskie' THEN 5 END ) AS Muskie_total ,
> SUM(CASE WHEN Species = 'Northern' THEN 1 END ) AS
> Northern_total ,
> SUM(CASE WHEN Species = 'Walleye' THEN 1 END ) AS Walleye_total ,
> SUM(CASE WHEN Species = 'Catfish' THEN 1 END ) AS Catfish_total,
> SUM(CASE WHEN Species = 'Crappie' THEN 1 END ) AS Crappie_Total ,
> SUM(CASE WHEN Species = 'Longest_fish ' THEN 5 END ) AS
> Longest_fish_Total
> FROM Fish
> Group by Angler- Hide quoted text -
> - Show quoted text -
Thanks!!!