Welcome To Snipplr
Everyone's Recent Snippets Tagged sql
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
count(*args)
Count operates using three different approaches.
Count all: By not passing any parameters to count, it will return a count of all the rows for the model.
Count using column: By passing a column name to count, it will return a count of...
1
656
posted 14 years ago by deschism
Bind the DropDownList like normal (set DataSourceID, DataTextField, DataValueField), and <%BIND%> the SelectedValue field. AutoPostBack should be enabled. In the OnSelectedIndexChanged:
0
770
posted 14 years ago by jink
Replace *SERVERNAME* with the name of the server name in the web.config
2
700
posted 14 years ago by jink
This is an example piece of code that will load a SubSonic collection into the "col1" object. The collection class is told to look for the column "VendorId" in the products table and pull it based based on the matching supplied vendorId.
0
582
posted 15 years ago by mordecaix7
This sql query will select the past version information about a given file from the database. An example would be searching for %ApprovalHistoryVOImpl% would return all past version numbers (in the database) for the ApprovalHistoryVOImpl.class file....
0
675
posted 15 years ago by theonlyalterego
Sometimes you want to return a bunch of data from a table, but you want it coming back in a random order. Maybe it's for keeping some content on a home page fresh. Here's how:
0
572
posted 15 years ago by blackf0rk
I am currently still working on this, and will make changes.
1
740
posted 15 years ago by jonniespratley
This is by no means the most efficient way to do this, in terms of performance.
It is however the easiest way.
1
635
posted 15 years ago by xtheonex
I was having the hardest time getting this to work. It's a collection of various items. For whatever reason, I needed to include the CASE statement due to NULL's coming back. If this helps you out... go for it.
0
567
posted 15 years ago by gembry
Create a random password using a Dictionary database table.
Selects a random word, and then appends two random numbers to the end, creating passwords in the form of: foozling98 or laicism11
1
612
posted 15 years ago by mynameisharry
Just replace TABLENAME.OLD_COLUMNNAME and NEW_COLUMNNAME with your new values.
0
623
posted 15 years ago by naspinski