Posts by Zu:
for xml explicit
select 1 as tag, null as parent, user_id as [li!1!title], name as [li!1] from t_users for xml explicit
comes out as:
<li title="1">user Name 1 </li> <li title="2">user Name 2 </li> <li title="3">user Name 3 </li> etc.
Debugging Classic ASP in VS08
1. Go to Control Panel>Administrative Tools>Computer Management. Add IWAM_ComputerName account to the Debugger Users group.
2. Create a Web Application Project in VS 2005 and add .asp files.
3. Create a virtual directory in IIS for the web application project that you created.
4. On the properties tab of the virtual directory in IIS do the following:
1. Click [...]
useful SQL queries
Find all users that are in tblUser table but are not in tblTransaction (very useful if there’s a foreign key issue)
SELECT USER_ID FROM tblTransaction WHERE USER_ID NOT IN (SELECT ID FROM TBLUSER)
Now this one is used when you have a table linking a many to many relationship. This query pulls all currently assigned individuals and [...]
Migrating and Encrypting
getOldUsers – read the ds one by one from the old db, where the passwords are not yet encrypted.
InsertUserx – writes the users into your new (current) db, with passwords encrypted.
Public Function MigrateUser() As Integer
Dim dr As DataRow
Dim ds As DataSet
Dim dt As DataTable
Dim userID As Integer
ds = getOldUsers()
dt = ds.Tables(0)
For Each dr In dt.Rows
newPass [...]
A more recent version of the file has been saved….
OMG. the following message has been popping up more and more often when using FTP via VS08, and the larger the project gets the more “No”s you have to click….
A more recent version of the file [filename] has been saved to the Web server by [username] on [DateTime]
Do you want to replace the server file [...]
Return Inserted Identity from Stored Procedure
Stored Procedure looks like this:
ALTER PROCEDURE [dbo].[spInsertSomething]
@txtName varchar(255),
@txtDisplayName varchar(80),
@txtPhone varchar(50)
AS
BEGIN
INSERT INTO tblSomeTable
(
txtName ,
txtDisplayName ,
txtPhone
)
VALUES
(
@ txtName ,
@ txtDisplayName ,
@ txtPhone
)
SELECT NEWID = SCOPE_IDENTITY()
END
.NET Repeaters Cheat Sheet (vb)
<asp:Repeater ID=”rpPostTest” runat=”server” OnItemDataBound=”rpPostTest_OnItemDataBound”>
<ItemTemplate>
<asp:Label ID=”lblQuestion” runat=”server”></asp:Label>
<asp:Label ID=”lblQID” visible=”false” runat=”server”></asp:Label>
<br />
<asp:RadioButtonList ID=”answer” runat=”server”  >
<asp:ListItem   Text=”True”  Value=”T” ></asp:ListItem>
<asp:ListItem  Text=”False”  Value=”F”></asp:ListItem>
</asp:RadioButtonList>
<hr />
</ItemTemplate>
</asp:Repeater>
create the repeater
<asp:Repeater ID="rpPostTest" runat="server" OnItemDataBound="rpPostTest_OnItemDataBound">
<ItemTemplate>
<asp:Label ID="lblQuestion" runat="server"></asp:Label>
<asp:Label ID="lblQID" visible="false" runat="server"></asp:Label>
<br />
<asp:RadioButtonList ID="answer" runat="server"Â >
<asp:ListItem Text="True" Value="T" ></asp:ListItem>
<asp:ListItem  Text="False" Value="F"></asp:ListItem>
</asp:RadioButtonList>
<hr />
</ItemTemplate>
</asp:Repeater>
back end code:
A few useful things to remember…
App_Offline.htm
“The way app_offline.htm works is that you place this file in the root of the application. When ASP.NET sees it, it will shut-down the app-domain for the application (and not restart it for requests) and instead send back the contents of the app_offline.htm file in response to all new dynamic requests for the application. [...]
Visual Studio 2005 Remote Debugger
I’ve had to do it 2 times so far, and each time i do it i have issues, which could be eliminated, if I saved my notes from the first time. so here goes.
1. from the Visual Studio CD, browse to tools -> remote debugger -> pick the right format and (x86 or x64) and [...]
Meeeeooooooooowwwwwwww
a story of a miniature schnauzer
i should be getting the puppy sometime next week, but here is a little introduction: