Showing posts with label newbie. Show all posts
Showing posts with label newbie. Show all posts

Wednesday, March 7, 2012

Realtional Tables

For starters, please forgive my newbie'ness as SQL is not my strongest area in any sense.

I am trying to create a web application which consists of a DDL which is databound and based on the selection in the 1st DDL, a gridview should be generated and populated with the criteria I'm looking for.

My trouble starts with the database. I have 2 tables that I'm working with - users and messages.

The users table consists of 2 columns; userid and useruri. The messages table consists of 2 tables; userid, body.

The first drop down list is populated from a database call of SELECT useruri, userid FROM users. The output of this DDL is simply each user's name. This works pefectly.

To build the gridview or output (because i'm not sure if gridview is the right word), the second table, messages, needs to be queried but I can't figure out how to take the userid from the users table and match it to the userid of the messages table, based on the selection in the DDL of the useruri, to build the view.

Does that make sense? Any help would be greatly appreciated.

Thanks,

Casey

You could use SqlDataSource controls and do it something like this:
User:<asp:dropdownlist id="ddlUsers" runat="server" autopostback="True" datasourceid="sdsUsers"datatextfield="Name" datavaluefield="Id" /><asp:sqldatasource id="sdsUsers" runat="server"connectionstring="<%$ ConnectionStrings:ed_testConnectionString%>" selectcommand="SELECT * FROM [User]"></asp:sqldatasource>Message:<asp:dropdownlist id="ddlMessages" runat="server" datasourceid="sdsMessages" datatextfield="Message"datavaluefield="msgId" /><asp:sqldatasource id="sdsMessages" runat="server" connectionstring="<%$ ConnectionStrings:ed_testConnectionString%>"selectcommand="SELECT [msgId], [Message] FROM [Message] WHERE ([Id] = @.Id)"><selectparameters><asp:controlparameter controlid="ddlUsers" name="Id" propertyname="SelectedValue"type="Int32" /></selectparameters></asp:sqldatasource>

really quick question

Hi all!
Can someone tell a newbie where to turn down the event log levels?
I'm getting 15 information alerts every 30 minutes and want to tone it down
a touch so my app logs are easier to read!! I've had a quick look in the sql
server management but can't find where you can set these levels.
Thanks very muchUnfortunately, you cannot change whether or not 2005 should write a particular system message to the
eventlog. You could do that in earlier versions using sp_altermessage. Having said that, there might
be some special handling for some particular message (logins is the only that comes in mind). What
are these messages?
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Paul" <paul@.wertyuiko.dfg> wrote in message news:%23f$GtKO1HHA.5160@.TK2MSFTNGP05.phx.gbl...
> Hi all!
> Can someone tell a newbie where to turn down the event log levels?
> I'm getting 15 information alerts every 30 minutes and want to tone it down a touch so my app logs
> are easier to read!! I've had a quick look in the sql server management but can't find where you
> can set these levels.
> Thanks very much
>

really quick question

Hi all!
Can someone tell a newbie where to turn down the event log levels?
I'm getting 15 information alerts every 30 minutes and want to tone it down
a touch so my app logs are easier to read!! I've had a quick look in the sql
server management but can't find where you can set these levels.
Thanks very muchUnfortunately, you cannot change whether or not 2005 should write a particul
ar system message to the
eventlog. You could do that in earlier versions using sp_altermessage. Havin
g said that, there might
be some special handling for some particular message (logins is the only tha
t comes in mind). What
are these messages?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Paul" <paul@.wertyuiko.dfg> wrote in message news:%23f$GtKO1HHA.5160@.TK2MSFTNGP05.phx.gbl...

> Hi all!
> Can someone tell a newbie where to turn down the event log levels?
> I'm getting 15 information alerts every 30 minutes and want to tone it dow
n a touch so my app logs
> are easier to read!! I've had a quick look in the sql server management bu
t can't find where you
> can set these levels.
> Thanks very much
>

Monday, February 20, 2012

Real Newbie Post...

I was hoping there would be a newbie section in here... But I'll post anyway (And sorry in advance if its a really dumb question)

I am using VWDE and have a SQL DB which has been imported from one of my existing forums, when it shows in the database explorer its show like below

tblArcade (jdName)
tblArcadePB (jdName)

etc..etc...

What I want to know is why this DB has (jdName) after the Table name and my other DB's shown don't?? They are just shown as

tblArcade
tblArcadePB

etc..etc..

My main questions are "How do I remove the brackets from the forum DB" as when I try to preview data in VWDE I get a message

Invalid object name 'tblArcade'.

I know its to do with this extra bit as it only happens to the tables that have this on the end... Hope that makes sense and someone can help me, if you could reply as if I'm really dumb it would be appreciatedEmbarrassed

Guessing this must be a stupid question...Embarrassed|||Anyone....Huh?|||Dammit... I'll keep clicking away in SQL till I get it to work...|||

This is because the table belongs to another schema rather than the default schema of the login which you use in the database connection. To access such database objects, you need to use full qualified names including schema name. For example:

SELECT * FROM jdName.tblArcade

For more information about schemas in SQL Server2005, you can refer to:

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