Showing posts with label tables. Show all posts
Showing posts with label tables. Show all posts

Thursday, March 29, 2012

Consolidate multiple databases via merge replication

Hi
I am trying to merge a set of tables from 5 separate databases (4 on
separate servers and 2 on the same server) into one 'master' database.
The tables being replicated all have unique ID ranges
How to I organise the replication so that the subscriber database can allow
inserts which fit into the ID ranges for the related Publishers database.
ie All inserts with a Lab_ID = 'L' should ONLY be replicated back to the
associated publisher.
I am not familiar with the automatic identity range handling .. can anyone
point me to an article about how this works ?
any help would be appreciated
cheers
mike
Mike,
as you've got multiple publishers, just ordinary filters will work to
restrict the flow of data to each publisher. For identity range handling,
you'll need to design each publisher's range yourself. The subscriber table
can be created during the first initialization, and all others are nosync
ones. So, the subscriber's identity range is defined after the first
initialization, and subsequent publications need to be sure not to overlap
with this range. Make the ranges large, because assignment of another range
might cause an overlap, so if the range is so big there will never be any
need to reset then this is best.
Alternatively, all subscriptions can be nosync ones.
These might help:
http://www.replicationanswers.com/No...alizations.asp
http://www.replicationanswers.com/ManualIdentities.asp
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

Tuesday, March 27, 2012

Consecutive result Set

Hello,
I am having two tables ...
SendMails (SendMailID,sender,subject)
Data is
1, 'Sender1','Subject1'
2, 'Sender2','Subject2'
3, 'Sender3','Subject3'
RecMails(RecMailId,Recieved,Subject)
Data is
4, 'Rec1','Subject4'
5, 'Rec2','Subject5'
6, 'Rec3','Subject6'
I want in the Report as
1, 'Sender1','Subject1'
2, 'Sender2','Subject2'
3, 'Sender3','Subject3'
4, 'Rec1','Subject4'
5, 'Rec2','Subject5'
6, 'Rec3','Subject6'
I am unable to get this from a single Query...
so I decided to have two tables in the body with one dataset each ...but it
leaves a big blank space in between .. Is there some way possible for this
requirement..
I also tried putting two tables in one group each within a third table but
the blank space remains...
any Idea will be highly appreciated..
Cheers,
siajAre you using a database that does not support a UNION in the query?
Otherwise, UNION them and have them in the same dataset.
--
Douglas McDowell douglas@.nospam.solidqualitylearning.com
"siaj" <siaj@.discussions.microsoft.com> wrote in message
news:E449AE49-ECE2-4B23-979D-D877C5BE3BC4@.microsoft.com...
> Hello,
> I am having two tables ...
> SendMails (SendMailID,sender,subject)
> Data is
> 1, 'Sender1','Subject1'
> 2, 'Sender2','Subject2'
> 3, 'Sender3','Subject3'
>
> RecMails(RecMailId,Recieved,Subject)
> Data is
> 4, 'Rec1','Subject4'
> 5, 'Rec2','Subject5'
> 6, 'Rec3','Subject6'
> I want in the Report as
> 1, 'Sender1','Subject1'
> 2, 'Sender2','Subject2'
> 3, 'Sender3','Subject3'
> 4, 'Rec1','Subject4'
> 5, 'Rec2','Subject5'
> 6, 'Rec3','Subject6'
>
> I am unable to get this from a single Query...
> so I decided to have two tables in the body with one dataset each ...but
> it
> leaves a big blank space in between .. Is there some way possible for this
> requirement..
> I also tried putting two tables in one group each within a third table but
> the blank space remains...
> any Idea will be highly appreciated..
> Cheers,
> siaj|||Thanks Douglas...
I am using SQL Server 2000...and I can very well use Union Operator.. It
had never clicked me..
Cheers,
siaj
"Douglas McDowell" wrote:
> Are you using a database that does not support a UNION in the query?
> Otherwise, UNION them and have them in the same dataset.
> --
> Douglas McDowell douglas@.nospam.solidqualitylearning.com
>
> "siaj" <siaj@.discussions.microsoft.com> wrote in message
> news:E449AE49-ECE2-4B23-979D-D877C5BE3BC4@.microsoft.com...
> > Hello,
> >
> > I am having two tables ...
> >
> > SendMails (SendMailID,sender,subject)
> > Data is
> > 1, 'Sender1','Subject1'
> > 2, 'Sender2','Subject2'
> > 3, 'Sender3','Subject3'
> >
> >
> > RecMails(RecMailId,Recieved,Subject)
> > Data is
> > 4, 'Rec1','Subject4'
> > 5, 'Rec2','Subject5'
> > 6, 'Rec3','Subject6'
> >
> > I want in the Report as
> >
> > 1, 'Sender1','Subject1'
> > 2, 'Sender2','Subject2'
> > 3, 'Sender3','Subject3'
> > 4, 'Rec1','Subject4'
> > 5, 'Rec2','Subject5'
> > 6, 'Rec3','Subject6'
> >
> >
> > I am unable to get this from a single Query...
> >
> > so I decided to have two tables in the body with one dataset each ...but
> > it
> > leaves a big blank space in between .. Is there some way possible for this
> > requirement..
> > I also tried putting two tables in one group each within a third table but
> > the blank space remains...
> > any Idea will be highly appreciated..
> >
> > Cheers,
> > siaj
>
>

Sunday, March 25, 2012

Cons w/ UDTs?

I came across a database at my company that contained many columns in many
tables defined as UDTs. Upon further investigation, there were no rules
associated with the UDTs and they were not explicitly bound.
Upon even further investigation, the person who created the database said
they were using a modeling tool to test the quality/validity of the data
model and the tool complained that no data domains were present and suggested
the utilization of UDTs.
After reading more about them, i was intrigued and can definitely see their
value. My question is are there any cons to using them? For example, can
over usage cause performance issues? What issues are encountered if a rule
or data type needs to be altered? Etc... Thanks in advance.parchk,
Are you using SQL Server 2000 or 2005? Things are changing.
User-Defined Types in 2000 and 2005 can simply be an alias for describing
data domains, but for both versions of SQL Server, the gotcha is: "When you
create a user-defined type, it is local to a single database." If you don't
care about cross-database use of the UDT, not even in tempdb, then no
problem. (But even then, 2005 offers some options that 2000 does not.)
(SQL Server 2000 syntax): EXEC sp_addtype SSN, 'varchar(11)', 'NOT NULL'
(SQL Server 2005 syntax): CREATE TYPE SSN FROM varchar(11) NOT NULL ;
Then you can use them in your code in the proper database as if they were a
native datatype.
I would guess that this is the type of UDT you have in your database. I
used to use them heavily, but decided that the value of using UDTs as
documentation of data domains was to small to repay the hassle. (And, when
you generate scripts you tend to get the base datatypes scripted out for
you.)
--
With 2005, there is now "CLR User-Defined Types". This is a much richer and
more complex type of UDT, where you define the type and the operations that
work with the datatype. If you need this, you need to read about them in
detail, starting in the SQL Server 2005 Books Online.
RLF
"parchk" <parchk@.discussions.microsoft.com> wrote in message
news:FDE0AF7A-68C5-495A-8F16-9D7FDDF6E607@.microsoft.com...
>I came across a database at my company that contained many columns in many
> tables defined as UDTs. Upon further investigation, there were no rules
> associated with the UDTs and they were not explicitly bound.
> Upon even further investigation, the person who created the database said
> they were using a modeling tool to test the quality/validity of the data
> model and the tool complained that no data domains were present and
> suggested
> the utilization of UDTs.
> After reading more about them, i was intrigued and can definitely see
> their
> value. My question is are there any cons to using them? For example, can
> over usage cause performance issues? What issues are encountered if a
> rule
> or data type needs to be altered? Etc... Thanks in advance.|||If you can imagine a db system that is 'strongly' typed, where
you can define types natively instead of going 'outside' the system
and where any type can be the type of a 'variable' not just
a value then I have a surprise for you :-)
www.beyondsql.blogspot.com
"Russell Fields" <russellfields@.nomail.com> wrote in message
news:eMMF6yO6HHA.2380@.TK2MSFTNGP02.phx.gbl...
> parchk,
> Are you using SQL Server 2000 or 2005? Things are changing.
> User-Defined Types in 2000 and 2005 can simply be an alias for describing
> data domains, but for both versions of SQL Server, the gotcha is: "When
> you create a user-defined type, it is local to a single database." If you
> don't care about cross-database use of the UDT, not even in tempdb, then
> no problem. (But even then, 2005 offers some options that 2000 does not.)
> (SQL Server 2000 syntax): EXEC sp_addtype SSN, 'varchar(11)', 'NOT NULL'
> (SQL Server 2005 syntax): CREATE TYPE SSN FROM varchar(11) NOT NULL ;
> Then you can use them in your code in the proper database as if they were
> a native datatype.
> I would guess that this is the type of UDT you have in your database. I
> used to use them heavily, but decided that the value of using UDTs as
> documentation of data domains was to small to repay the hassle. (And,
> when you generate scripts you tend to get the base datatypes scripted out
> for you.)
> --
> With 2005, there is now "CLR User-Defined Types". This is a much richer
> and more complex type of UDT, where you define the type and the operations
> that work with the datatype. If you need this, you need to read about
> them in detail, starting in the SQL Server 2005 Books Online.
> RLF
>
> "parchk" <parchk@.discussions.microsoft.com> wrote in message
> news:FDE0AF7A-68C5-495A-8F16-9D7FDDF6E607@.microsoft.com...
>>I came across a database at my company that contained many columns in many
>> tables defined as UDTs. Upon further investigation, there were no rules
>> associated with the UDTs and they were not explicitly bound.
>> Upon even further investigation, the person who created the database said
>> they were using a modeling tool to test the quality/validity of the data
>> model and the tool complained that no data domains were present and
>> suggested
>> the utilization of UDTs.
>> After reading more about them, i was intrigued and can definitely see
>> their
>> value. My question is are there any cons to using them? For example,
>> can
>> over usage cause performance issues? What issues are encountered if a
>> rule
>> or data type needs to be altered? Etc... Thanks in advance.
>|||Hi Russell,
We are using 2005. Thanks for your response. For databases that make heavy
use of UDTs to define data domains, is there any performance impact? The
volume will not be high; however, the database is involved with replication.
"Russell Fields" wrote:
> parchk,
> Are you using SQL Server 2000 or 2005? Things are changing.
> User-Defined Types in 2000 and 2005 can simply be an alias for describing
> data domains, but for both versions of SQL Server, the gotcha is: "When you
> create a user-defined type, it is local to a single database." If you don't
> care about cross-database use of the UDT, not even in tempdb, then no
> problem. (But even then, 2005 offers some options that 2000 does not.)
> (SQL Server 2000 syntax): EXEC sp_addtype SSN, 'varchar(11)', 'NOT NULL'
> (SQL Server 2005 syntax): CREATE TYPE SSN FROM varchar(11) NOT NULL ;
> Then you can use them in your code in the proper database as if they were a
> native datatype.
> I would guess that this is the type of UDT you have in your database. I
> used to use them heavily, but decided that the value of using UDTs as
> documentation of data domains was to small to repay the hassle. (And, when
> you generate scripts you tend to get the base datatypes scripted out for
> you.)
> --
> With 2005, there is now "CLR User-Defined Types". This is a much richer and
> more complex type of UDT, where you define the type and the operations that
> work with the datatype. If you need this, you need to read about them in
> detail, starting in the SQL Server 2005 Books Online.
> RLF
>
> "parchk" <parchk@.discussions.microsoft.com> wrote in message
> news:FDE0AF7A-68C5-495A-8F16-9D7FDDF6E607@.microsoft.com...
> >I came across a database at my company that contained many columns in many
> > tables defined as UDTs. Upon further investigation, there were no rules
> > associated with the UDTs and they were not explicitly bound.
> >
> > Upon even further investigation, the person who created the database said
> > they were using a modeling tool to test the quality/validity of the data
> > model and the tool complained that no data domains were present and
> > suggested
> > the utilization of UDTs.
> >
> > After reading more about them, i was intrigued and can definitely see
> > their
> > value. My question is are there any cons to using them? For example, can
> > over usage cause performance issues? What issues are encountered if a
> > rule
> > or data type needs to be altered? Etc... Thanks in advance.
>
>|||So overall would you recommend extensive utilization of UDTs for defining
data domains and/or the other capabilites of UDTs?
"Russell Fields" wrote:
> parchk,
> Are you using SQL Server 2000 or 2005? Things are changing.
> User-Defined Types in 2000 and 2005 can simply be an alias for describing
> data domains, but for both versions of SQL Server, the gotcha is: "When you
> create a user-defined type, it is local to a single database." If you don't
> care about cross-database use of the UDT, not even in tempdb, then no
> problem. (But even then, 2005 offers some options that 2000 does not.)
> (SQL Server 2000 syntax): EXEC sp_addtype SSN, 'varchar(11)', 'NOT NULL'
> (SQL Server 2005 syntax): CREATE TYPE SSN FROM varchar(11) NOT NULL ;
> Then you can use them in your code in the proper database as if they were a
> native datatype.
> I would guess that this is the type of UDT you have in your database. I
> used to use them heavily, but decided that the value of using UDTs as
> documentation of data domains was to small to repay the hassle. (And, when
> you generate scripts you tend to get the base datatypes scripted out for
> you.)
> --
> With 2005, there is now "CLR User-Defined Types". This is a much richer and
> more complex type of UDT, where you define the type and the operations that
> work with the datatype. If you need this, you need to read about them in
> detail, starting in the SQL Server 2005 Books Online.
> RLF
>
> "parchk" <parchk@.discussions.microsoft.com> wrote in message
> news:FDE0AF7A-68C5-495A-8F16-9D7FDDF6E607@.microsoft.com...
> >I came across a database at my company that contained many columns in many
> > tables defined as UDTs. Upon further investigation, there were no rules
> > associated with the UDTs and they were not explicitly bound.
> >
> > Upon even further investigation, the person who created the database said
> > they were using a modeling tool to test the quality/validity of the data
> > model and the tool complained that no data domains were present and
> > suggested
> > the utilization of UDTs.
> >
> > After reading more about them, i was intrigued and can definitely see
> > their
> > value. My question is are there any cons to using them? For example, can
> > over usage cause performance issues? What issues are encountered if a
> > rule
> > or data type needs to be altered? Etc... Thanks in advance.
>
>|||Parchk,
The 'alias' form of UDTs should have absolutely no performance overhead. It
is really just a naming / documentation scheme.
In terms of replication (I am not a replication expert) I would say that you
want to make sure that the UDTs are also replicated or created with the same
id on the replicated database. And even that is probably not completely
necessary, since the underlying datatypes are knows on both servers.
(Perhaps someone who does replication a lot, can add a comment.)
RLF
"parchk" <parchk@.discussions.microsoft.com> wrote in message
news:4512EE17-B439-46FE-9504-86F7BD01A882@.microsoft.com...
> Hi Russell,
> We are using 2005. Thanks for your response. For databases that make
> heavy
> use of UDTs to define data domains, is there any performance impact? The
> volume will not be high; however, the database is involved with
> replication.
> "Russell Fields" wrote:
>> parchk,
>> Are you using SQL Server 2000 or 2005? Things are changing.
>> User-Defined Types in 2000 and 2005 can simply be an alias for describing
>> data domains, but for both versions of SQL Server, the gotcha is: "When
>> you
>> create a user-defined type, it is local to a single database." If you
>> don't
>> care about cross-database use of the UDT, not even in tempdb, then no
>> problem. (But even then, 2005 offers some options that 2000 does not.)
>> (SQL Server 2000 syntax): EXEC sp_addtype SSN, 'varchar(11)', 'NOT NULL'
>> (SQL Server 2005 syntax): CREATE TYPE SSN FROM varchar(11) NOT NULL ;
>> Then you can use them in your code in the proper database as if they were
>> a
>> native datatype.
>> I would guess that this is the type of UDT you have in your database. I
>> used to use them heavily, but decided that the value of using UDTs as
>> documentation of data domains was to small to repay the hassle. (And,
>> when
>> you generate scripts you tend to get the base datatypes scripted out for
>> you.)
>> --
>> With 2005, there is now "CLR User-Defined Types". This is a much richer
>> and
>> more complex type of UDT, where you define the type and the operations
>> that
>> work with the datatype. If you need this, you need to read about them in
>> detail, starting in the SQL Server 2005 Books Online.
>> RLF
>>
>> "parchk" <parchk@.discussions.microsoft.com> wrote in message
>> news:FDE0AF7A-68C5-495A-8F16-9D7FDDF6E607@.microsoft.com...
>> >I came across a database at my company that contained many columns in
>> >many
>> > tables defined as UDTs. Upon further investigation, there were no
>> > rules
>> > associated with the UDTs and they were not explicitly bound.
>> >
>> > Upon even further investigation, the person who created the database
>> > said
>> > they were using a modeling tool to test the quality/validity of the
>> > data
>> > model and the tool complained that no data domains were present and
>> > suggested
>> > the utilization of UDTs.
>> >
>> > After reading more about them, i was intrigued and can definitely see
>> > their
>> > value. My question is are there any cons to using them? For example,
>> > can
>> > over usage cause performance issues? What issues are encountered if a
>> > rule
>> > or data type needs to be altered? Etc... Thanks in advance.
>>|||Parchk,
It is handy for defining things that you want to be the same everywhere.
For example:
CREATE TYPE SSN FROM varchar(11) NOT NULL
If you use this everywhere a Social Security Number is needed, then the
columns and variables will always be 11-characters, which leaves room for
the dashes, eg. 123-45-6789. This helps avoid having some places coded for
varchar(9), which is intended for 123456789 without dashes, but might wind
up holding 123-45-67 which, of course, is invalid.
The thing that moved me away from using them was the cross-database issues.
These are describe in the 2005 Books Online topic: "Using User-defined Types
Across Databases". It seems, without testing, like it is a little more
robust than in earlier versions, but there are still things to be dealt
with.
I switched over to using class names for my columns, which has served me
well in the years since then. e.g.
Policy_Holder_SocialSecurityNumber
Mate_SocialSecurityNumber
Business_PhoneNumber
Person_FamilyName
In these examples the final token of the column (or variable) name is the
data class. This does not, of course, enforce that everyone defines the
same datatype for the class names. Documentation and review are needed to
catch errors.
FWIW,
RLF
"parchk" <parchk@.discussions.microsoft.com> wrote in message
news:6B7E0FAD-0EA4-46C7-98AE-825692FC1543@.microsoft.com...
> So overall would you recommend extensive utilization of UDTs for defining
> data domains and/or the other capabilites of UDTs?
> "Russell Fields" wrote:
>> parchk,
>> Are you using SQL Server 2000 or 2005? Things are changing.
>> User-Defined Types in 2000 and 2005 can simply be an alias for describing
>> data domains, but for both versions of SQL Server, the gotcha is: "When
>> you
>> create a user-defined type, it is local to a single database." If you
>> don't
>> care about cross-database use of the UDT, not even in tempdb, then no
>> problem. (But even then, 2005 offers some options that 2000 does not.)
>> (SQL Server 2000 syntax): EXEC sp_addtype SSN, 'varchar(11)', 'NOT NULL'
>> (SQL Server 2005 syntax): CREATE TYPE SSN FROM varchar(11) NOT NULL ;
>> Then you can use them in your code in the proper database as if they were
>> a
>> native datatype.
>> I would guess that this is the type of UDT you have in your database. I
>> used to use them heavily, but decided that the value of using UDTs as
>> documentation of data domains was to small to repay the hassle. (And,
>> when
>> you generate scripts you tend to get the base datatypes scripted out for
>> you.)
>> --
>> With 2005, there is now "CLR User-Defined Types". This is a much richer
>> and
>> more complex type of UDT, where you define the type and the operations
>> that
>> work with the datatype. If you need this, you need to read about them in
>> detail, starting in the SQL Server 2005 Books Online.
>> RLF
>>
>> "parchk" <parchk@.discussions.microsoft.com> wrote in message
>> news:FDE0AF7A-68C5-495A-8F16-9D7FDDF6E607@.microsoft.com...
>> >I came across a database at my company that contained many columns in
>> >many
>> > tables defined as UDTs. Upon further investigation, there were no
>> > rules
>> > associated with the UDTs and they were not explicitly bound.
>> >
>> > Upon even further investigation, the person who created the database
>> > said
>> > they were using a modeling tool to test the quality/validity of the
>> > data
>> > model and the tool complained that no data domains were present and
>> > suggested
>> > the utilization of UDTs.
>> >
>> > After reading more about them, i was intrigued and can definitely see
>> > their
>> > value. My question is are there any cons to using them? For example,
>> > can
>> > over usage cause performance issues? What issues are encountered if a
>> > rule
>> > or data type needs to be altered? Etc... Thanks in advance.
>>

connexion, processes ...

From the system table sysprocesses, how to do in order to extract
the SQL command related to the processes ?
What are system views/tables, scripts used to monitor and obtain more information
about processes, connexions... ?Straight from the Holy Book (SQL books Online)
----------------------
DECLARE @.Handle binary(20)
SELECT @.Handle = sql_handle FROM sysprocesses WHERE spid = 52
SELECT * FROM ::fn_get_sql(@.Handle)

----------------------|||Thanks for the reply, but the code is not working in my server (and mya be this is due to SP...). By the way, how to find the last SP applied to sql server ?

DBCC INPUTBUFFER(80)
EventType Parameters EventInfo
--- ---- ---------
RPC Event 0 DVSPAYS_CODELIB_DVSPRINC_S;1

DECLARE @.Handle binary(20)
SELECT @.Handle = sql_handle FROM sysprocesses WHERE spid = 80
SELECT * FROM ::fn_get_sql(@.Handle)
dbid objectid number encrypted text
-- ---- -- --- ----------------------------------------------------------------------------
No row(s)sqlsql

Thursday, March 22, 2012

ConnectionString property has not been initialized

My IT dept set up an SQL db on a server for me and I am connected to it through a port. They told me I had to create my tables through an MS Access adp, which I have done. I am using VWD Express and am trying to create a login page using usernames and pw's from a db table. I am connected (at least the db Explorer tab shows I am) to the MS Access adp and can drop a GridView from my Employees table from it onto a page and get results. I keep getting the "ConnectionString property not initialized" error message pointing to my sqlConn.Open() statement and cannot figure out why. I have looked at hundreds of posts but can't seem to find anything that works. If someone could point me to some post or website that could explain connecting to a SQL db through a port or whatever you think I need to learn to get this fixed I would appreciate it.
Web config:

<configurationxmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

<appSettings/>

<connectionStrings>

<addname="ASPNETDB"connectionString="Description=Training;DRIVER=SQL Server;SERVER=USAWVAS27;UID=usx14611;APP=Microsoft? Visual Studio? 2005;WSID=983QD21;Network=DBMSSOCN;Address=USAWVAS27,3180;Trusted_Connection=Yes"providerName="System.Data.Odbc"/>

</connectionStrings>

<system.web>

<authenticationmode="Forms" />

<authorization>

<denyusers="?" />

</authorization>

<customErrorsmode="Off" />

</system.web>

</configuration>
My login.aspx page

<%@.PageLanguage="VB"debug="true"%>

<%@.ImportNamespace="System.Data.SqlClient" %>

<%@.ImportNamespace="System.Configuration.ConfigurationManager" %>

<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<scriptrunat="server">

ProtectedSub LoginUser(ByVal sAsObject,ByVal eAs EventArgs)

Dim blnAuthenticateAsBoolean = Authenticate(username.Text, password.Text)

If blnAuthenticateThen

FormsAuthentication.RedirectFromLoginPage(username.Text,False)

EndIf

EndSub

Function Authenticate(ByVal strUsernameAsString,ByVal strPasswordAsString)AsBoolean

Dim strConnectionAsString = ConfigurationManager.AppSettings("ASPNETDB")

Tried this code as well
Dim sqlConn As New SqlConnection(ConfigurationManager.AppSettings("ASPNETDB"))

Dim sqlConnAsNew SqlConnection(strConnection)

Dim sqlCmdAs SqlCommand

Dim sqlDRAs SqlDataReader

Dim userFoundAsBoolean

sqlCmd =New SqlCommand("SELECT * FROM Employees " & _

"WHERE username='" & strUsername &" ' AND password='" & strPassword &"'", sqlConn)

sqlConn.Open()

sqlDR = sqlCmd.ExecuteReader()

userFound = sqlDR.Read()

sqlDR.Close()

Return userFound

EndFunction

</script>

<htmlxmlns="http://www.w3.org/1999/xhtml">

<headrunat="server">

<title>Untitled Page</title>

</head>

<body>

<formid="form1"runat="server">

<div>

<p>Username:<asp:TextBoxID="username"runat="server"></asp:TextBox><br/>

<br/>

<p>Password:<asp:TextBoxID="password"runat="server"></asp:TextBox><br/>


<br/>

<asp:ButtonID="btnSubmit"runat="server"Text="Login"OnClick="LoginUser"/> </div>

</form>

</body>

</html>
Thanks

Still trying to figure this out. I can't believe that there isn't some resource(book, website..) out their that explains these types of errors. My IT dept insists that the database was set up correctly to allow me to use a table with usernames and pw's to build a login page but no matter what I try I get the same message. There doesn't seem to be any reason whatsoever for it to not work. I'm not even getting errors when I debug, just when I enter a login/password onto my login.aspx page and submit.
I removed my database connection and reconnected which gave me this as a new connection string:

<connectionStrings>

<addname="connString"connectionString="Data Source=USAWVAS27;Initial Catalog=MaterialsTraining;Integrated Security=False"/>

</connectionStrings>
Anybody have any ideas?
Thanks,
Toni

|||I haven't done this in VB, but here's what I think it should be based on how C# does it.
Looks like this:

Dim strConnectionAsString = ConfigurationManager.AppSettings("ASPNETDB")

Should be this:

Dim strConnectionAsString = ConfigurationManager.ConnectionStrings("ASPNETDB").ConnectionString

|||

Finally got this figured out so thought I'd share it. Thanks to those who responded with suggestions. It didn't like "DRIVER" and "Description" in my original system generated connection string, I'm assuming because it is an SQL database (?)
<connectionStrings>

<addname="ASPNETDB"connectionString="DataSource=Training;server=USAWVAS27;wsid=983QD21;network=DBMSSOCN;address=USAWVAS27,3180;trusted_connection=Yes"/>

</connectionStrings>

|||Hello, am getting a similar problem to the one you had. But I stilldon't know how to fix it. I only get the error when am runnign thelogin.It says the conn is not initialized. It's been giving me aheadache for 2 days now. Please help if possible
Protected Sub loginBtn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles loginBtn.Click
Dim strConnection As String = ConfigurationManager.AppSettings("sups")
Dim conn As New SqlConnection(strConnection)
Dim cmd As SqlCommand
Dim read As SqlDataReader
conn.Open()
The web.config file is like this...
<configuration>
<appSettings/>
<connectionStrings>
<add name="sups"connectionString="server=localhost;Trusted_Connection=true;database=sups;uid=abcd; pwd=abcd;" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
Where am I going wrong? Thanks a lot
|||I fixed this error with this if anyone is having problems

Dim sSQL As String
sSQL = "SELECT * FROM optionitems WHERE id=" & ID.ToString


Dim conn As New SqlConnection(ConfigurationManager.ConnectionStrings("cre8StoreConnectionString").ConnectionString)
Dim cmd As New SqlCommand(sSQL)
conn.Open()
cmd.Connection = conn

Dim reader As SqlDataReader = cmd.ExecuteReader

the problem I was having to genrate this error was caused because I was using the datareader without assigning a connection to the SQLcommand object.

Wednesday, March 7, 2012

Connection timeout when generating recordset from a stored procedure in an ASP page

I'm trying to create a binding to a stored procedure on a SQL server. I can
create the database connection and view the tables and stored procedures.
When I try to create a stored procedure binding I can choose the connection
and the procedure. But when I check "Returns DataSet" and click Test... I
get the following Dreamweaver error after a minute or so:
A server timeout has occured. Here are the possible reasons.
1. Please make sure that the webserver is up and running.
2. Please verify that the ODBC DSN exists on the testing server.
Executing the stored procedure in SQL Query Analyzer returns results in less
than 5 seconds.
My webserver is up and running and the web.config file is the same on both
the local machine and testing server. The SQL server and webserver are
different machines. My stored procedure is below.
I can create datasets (querys) on the database tables. It's only when I try
to generate a dataset from a stored procedure that run into problems.
If it matters I'm using ASP.NET VB, SQL Server 2000, IIS 5.0, .NET 1.1 and
Dreamweaver MX 2004.
Please help, I'm at a standstill.
I get the same problem when using VB .NET to to create the ASP page. If I
use Coldfusion instead on ASP it works flawlessly. Only problem is I that
have a developers license for Coldfusion so this is not an acceptable
workaround.
Thanks in advance!! My stored procedure is below:
CREATE PROCEDURE proc_combinedDB
(@.platform varchar(40), @.server varchar(40),@.keyword varchar(50))
WITH RECOMPILE
AS
SELECT *
FROM [prtracker_classworks].[dbo].[Problem Reports]
WHERE [Workstation OS] LIKE @.platform AND [Server OS] LIKE @.server A
ND
Details LIKE @.keyword
UNION ALL
SELECT *
FROM [prtracker_mac bugs].[dbo].[Problem Reports]
WHERE [Workstation OS] LIKE @.platform AND [Server OS]
LIKE @.server AND Details LIKE @.keyword
UNION ALL
SELECT *
FROM [Prtracker_Arizona State Edition].[dbo].[Problem Re
ports]
WHERE [Workstation OS] LIKE @.platform AND [Server OS] LIKE @.server A
ND
Details LIKE @.keyword
... // And so on for 15 more databases
RETURN
GOHi,
I am getting the same error using DWMX 2004 / ASP / VB.
Did you found a workaround ?
If so, your help is greatly apreciated.
axiaxi2003@.hotmail.com
A
amucino
---
Posted via http://www.mcse.ms
---
View this thread: http://www.mcse.ms/message466748.html

Friday, February 24, 2012

Connection String Options ...Urgent .. plz reply

Hi

In my project , we are using Dsn and DSN less connection, for certain functionality

we are providing users to select tables and views .

we don't want that all system tables and views are listed for selecting , how can we achieve this functionality?

Is there any options in the connection string for restricting system tables and views?

Any help is much appriciated

Thanks

Saurabh

Book mark the following site;

http://www.connectionstrings.com/