Not too sure if this will help but when I have a structure like that I use a reader. I can then write the following: if(r.Read()){ // they are valid, get user info if(r.NextResultSet()){ while(r.Read()){ // return additional data for that person } } } r.close(); *->>Always working on my game, teach me *->>something new. cout << "dav1d\n"; -- modified at 12:45 Monday 3rd October, 2005
afronaut
Posts
-
Multiple Selects in SP -
SQL : how to change the data type of a columnJust use the ALTER COLUMN syntax. If I had the following table: CREATE TABLE DContact( CONTACTID INT IDENTITY(1,1), CONTACT VARCHAR(50), COMPANY VARCHAR(50), EMAIL VARCHAR(50) ) I could change things like so: ALTER TABLE DContact ALTER COLUMN Email VARCHAR(100) GO This is TSQL that I wrote and tested, but it should be generic enough to work with your database. *->>Always working on my game, teach me *->>something new. cout << "dav1d\n";
-
Query questionHey all, I've got data structured like this: ID - Contact - Company - Email 1 - Jeff - Acme - Jeff@Acme.com 2 - Hester - Acme - Hester@Acme.com 3 - Mort - Acme - Mort@Acme.com 4 - Jason - Widget - Jason@Widget.com 5 - Harriet - Widget - Harriet@Widget.com I need to write a query that will return only the first contact for each company, in this case it should return: ---------------------------------------- 1 - Jeff - Acme - Jeff@Acme.com 4 - Jason - Widget - Jason@Widget.com Thanks in advance! *->>Always working on my game, teach me *->>something new. cout << "dav1d\n";
-
Moveable Type .NET clone?Hey all, does anyone know of a .NET implementation of photoblogging software that is open source? I'm thinking of starting South Dakota's first photoblog but I'd like to automate things a wee bit. *->>Always working on my game, teach me *->>something new. cout << "dav1d\n";
-
Javascript EncodingI'm writing a simple program in Javascript that dynamically processes Xpaths. So when I read a xml document, I want to display it in a Div with the innerHTML property. To take care the the > and <, I do a string replace. But I was wondering if there is a built in function for doing this type of encoding rather than a search/replace. Anyone know? *->>Always working on my game, teach me *->>something new. cout << "dav1d\n";
-
visibility in css and javascriptNot so, paste the following into a doc: function h(){ Contain.style.visibility="hidden"; }
test test
*->>Always working on my game, teach me *->>something new. cout << "dav1d\n";
-
connecting to an oracle database from an ASP pageYou should be able to find the connection string here: http://www.connectionstrings.com/[^] *->>Always working on my game, teach me *->>something new. cout << "dav1d\n";
-
DIV innerHtml for XML?Hey all - I'm trying to display an xml document in a DIV. After retrieving the data, I do a replace for all "<" and ">" in the original xml text. I'm now setting the result to the innerHtml property of a div but nothing displays. Can anyone lend some insight? *->>Always working on my game, teach me *->>something new. cout << "dav1d\n";
-
sql to export access table to html fileWrite a VBScript and use the Command scheduler. *->>Always working on my game, teach me *->>something new. cout << "dav1d\n";
-
dateTime column in datagridUse the DataFormattingExpression property. When you get your grid's properties, select your column and you should see an option. For example, you can use expressions like {0:d}, {0:f}, and so on. A full list can be found: http://www.stevex.org/dottext/articles/158.aspx[^] *->>Always working on my game, teach me *->>something new. cout << "dav1d\n";
-
SQl statement doesn't work why?I'm just taking a stab here but why are you assigning a recordsource property when in actuality you're executing a sql action statement? If you're using VB6 and ADO, you can use the connection object's 'execute' method to execute a sql statement, after which you can refresh your recordsource. *->>Always working on my game, teach me *->>something new. cout << "dav1d\n";
-
Getting metadata from SQL ServerSQL DMO is a great library for getting Sql Server metadata. See: http://www.sqlteam.com/item.asp?ItemID=9093[^]. It gives you a bit more flexibility than running queries like "select * from sysobjects where type='u'" and so on. It gives you a navigable heirarchy as well. You can get schema info using the .NET framework, but for what you're describing, I'd use DMO. *->>Always working on my game, teach me *->>something new. cout << "dav1d\n";
-
SQL statement against MS accessTry setting a breakpoint on the line where to set your sql variable. Run the program in the debugger and set a watch for your sql variable. Once you know *exactly* what your sql statement looks like, run it in access to make sure it is syntactically correct. You may be missing a "'" or something - *->>Always working on my game, teach me *->>something new. cout << "dav1d\n";
-
SQL statement against MS accessHm - I would have written it as: for exact matches - "Select * from Volunteers Where [Last_Name] = '" & strSearch & "'" for wild cards - "Select * from Volunteers Where [Last_Name] Like '" & strSearch & "%'" I believe this will work with access, try the query builder tool. *->>Always working on my game, teach me *->>something new. cout << "dav1d\n";
-
Recursive TriggersHey all, just for giggles, I was trying to figure out how these works. I created the following table:
Create Table Emps( EmployeeID int identity(1,1), EmpName varchar(100), ManagerID int, ActiveFlag char(1) )
insert into emps(empname)values('Big Boss') insert into emps(empname, managerid)values('David', 1) insert into emps(empname, managerid)values('Holly', 2) insert into emps(empname, managerid)values('Samwell', 3) insert into emps(empname, managerid)values('Ian', 4)
-- set everyone active update emps set activeflag = 'Y'CREATE TRIGGER EmpTrig ON emps For UPDATE AS UPDATE Emps SET ActiveFlag= i.activeflag FROM (Emps e INNER JOIN Inserted i ON e.managerid = i.employeeid) GO
The idea was that this would set everyone in a heirarchy "Inactive" if the manager was set inactive. Unfortunately, it does this only one level deep. How can I enable recursive triggers? Thanks in advance - *->>Always working on my game, teach me *->>something new. cout << "dav1d\n"; -
Dynamic ValidationHey all, Is there a way to bind a validation control to a group of controls on screen? I'm aware of the CausesValidation property but this sometimes breaks down when there are groups of controls on the screen for which you wish a control to initialize validation. Thanks much - *->>Always working on my game, teach me *->>something new. cout << "dav1d\n";
-
Optimizing LoadControlHey all - I'm using the LoadControl method of the Page object to dynamically load user controls based on a configuration from a database. I've noticed that this is particularly slow - has anyone here done optimization for this process of dynamically loading user controls from a database? I'm thinking of storing references ahead of time and using a Session object, but I'm not so sure of that approach... *->>Always working on my game, teach me *->>something new. cout << "dav1d\n";
-
Regex weakling helpHey all, Work is really boring so I'm going to write a screen scraper. But the best say to do this is using Regex's, something I need to work on because it's a particular area of weakness. If a page has the following structure: foo
foo
foo
Is there a regex I could use to pick up what's between the tags? Like a regex to grab the title, another for the first table, and the second? Thanks much *->>Always working on my game, teach me *->>something new. cout << "dav1d\n";
-
Simple ReflenctionThank you Charles. *->>Always working on my game, teach me *->>something new. cout << "dav1d\n";
-
Simple ReflenctionHey all - Really quickly, how can I dynamically change a property with reflection? For example, if I have a class:
class Foo{ public bool Enabled{...} }
I can dynamically load the class with the following:Type t = System.GetType("David.Demo.Foo"); // how can I set Enabled to false?
Thanks much, *->>Always working on my game, teach me *->>something new. cout << "dav1d\n";