Thursday, September 14, 2006

How to access control in FormView

How to access control in FormView: "TextBox DataTitle = (TextBox)DataSourceItemView.FindControl('DataTitle');"




=================
protected void FormView1_ItemCreated(object sender, EventArgs e)
{
if (FormView1.CurrentMode == FormViewMode.Insert)
{
TextBox txtName =
FormView1.Row.FindControl("CategoryNameTextBox") as TextBox;

txtName.Text = "New Name...";
}

}
==================

Thursday, August 10, 2006

Richard Dudley : The Assembly Version ( [ASSEMBLYVERSION] ) does not match the Database Version ( [DATABASEVERSION] )

Richard Dudley : The Assembly Version ( [ASSEMBLYVERSION] ) does not match the Database Version ( [DATABASEVERSION] ): "The Assembly Version ( [ASSEMBLYVERSION] ) does not match the Database Version ( [DATABASEVERSION] ) "

I think this is mainly a connection problem. Be sure to stop the Visual Studio Web server in the tool tray.

Wednesday, August 09, 2006

Error: Failed to generate a user instance of SQL Server... | differentpla.net

Error: Failed to generate a user instance of SQL Server... differentpla.net: "Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed."

Thursday, July 27, 2006

Clear the List of URLs That Appear in the Internet Explorer Address Bar

How Can I Clear the List of URLs That Appear in the Internet Explorer Address Bar?
Q
Hey, Scripting Guy! How can I clear the list of URLs that appear in the Internet Explorer address bar?
-- GA
A
Hey, GA. You know, if you’ve ever pondered the question, “What is it that makes the Scripting Guys different from other Microsoft employees?” well, we can save you some time and trouble by just giving you the answer: the Scripting Guys are dumber than other Microsoft employees. For example, it turns out that the list of URLs that appear in the Internet Explorer address bar drop-down list are stored in the registry; to be more specific, they are stored in this registry key:HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\TypedURLs


Hey, Scripting Guy!

Tuesday, July 18, 2006

BET: Excel - Functions User Defined - REVERSE

BET: Excel - Functions User Defined - REVERSE: "Returns the contents of a cell with all the characters reversed."

Chris Hays's Reporting Services Sleazy Hacks Weblog

Here is how to create a green bar alternating line color in Microsoft Reporting Services:


Chris Hays's Reporting Services Sleazy Hacks Weblog

Wednesday, July 12, 2006

Free - Reporting on Hierarchical Recursive data using MS Reporting Services - ColdFusion Development - CFzone.NET

Here is how to do a reporting services in C#:

Free - Reporting on Hierarchical Recursive data using MS Reporting Services - ColdFusion Development - CFzone.NET


private void Form1_Load(object sender, EventArgs e)
{
//declare connection string
string cnString = @"Data Source=(local);Initial Catalog=northwind;" + "User Id=northwind;Password=northwind";
//use following if you use standard security
//string cnString = @"Data Source=(local);Initial
//Catalog=northwind; Integrated Security=SSPI";
//declare Connection, command and other related objects
SqlConnection conReport = new SqlConnection(cnString);
SqlCommand cmdReport = new SqlCommand();
SqlDataReader drReport;
DataSet dsReport = new dsEmployee();
try
{
//open connection
conReport.Open();
//prepare connection object to get the data through reader and
// populate into dataset
cmdReport.CommandType = CommandType.Text;
cmdReport.Connection = conReport;
cmdReport.CommandText = "Select FirstName + ' ' + Lastname AS
EmployeeName, EmployeeID, ReportsTo From Employees";
//read data from command object
drReport = cmdReport.ExecuteReader();
//new cool thing with ADO.NET... load data directly from reader
// to dataset
dsReport.Tables[0].Load(drReport);
//close reader and connection
drReport.Close();
conReport.Close();
//provide local report information to viewer
reportViewer.LocalReport.ReportEmbeddedResource =
"RecursiveData.rptRecursiveData.rdlc";
//prepare report data source
ReportDataSource rds = new ReportDataSource();
rds.Name = "dsEmployee_dtEmployee";
rds.Value = dsReport.Tables[0];
reportViewer.LocalReport.DataSources.Add(rds);
//load report viewer
reportViewer.RefreshReport();
}
catch (Exception ex)
{
//display generic error message back to user
MessageBox.Show(ex.Message);
}
finally
{
//check if connection is still open then attempt to close it
if (conReport.State == ConnectionState.Open)
{
conReport.Close();
}
}
}

Thursday, July 06, 2006

The Bumpy Blog : IsNumeric in C#, WHY NOT?

Here is how to do a "IsNumeric in C#":


using System.Text.RegularExpressions;

static bool IsNumeric(string inputString)
{ return Regex.IsMatch(inputString, "^[0-9]+$"); }



I found it here:
The Bumpy Blog : IsNumeric in C#, WHY NOT?: "static bool IsNumeric(string inputString)
{
return Regex.IsMatch(inputString, '^[0-9]+$');
}"

Wednesday, June 07, 2006

Is a Temporary Table Really Necessary?

Is a Temporary Table Really Necessary?

Shows how to do looping in SQL.

WHILE @lngLoopCount <> 0BEGIN
SET @strTabName = (SELECT strTableName FROM #tTables WHERE numID = @lngLoopCount)
EXEC sp_spaceused @strTabName
SET @lngLoopCount = @lngLoopCount - 1END

Tuesday, June 06, 2006

Unskilled and Unaware of It: How Difficulties in Recognizing One's Own

Unskilled and Unaware of It: How Difficulties in Recognizing One's Own
Incompetence Lead to Inflated Self-Assessments

http://www.apa.org/journals/features/psp7761121.pdf

Monday, March 13, 2006

Fabulous Poems To Motivate And Inspire You To Achieve Your Dreams!

Fabulous Poems To Motivate And Inspire You To Achieve Your Dreams!: "A Creed To Live By


Don't undermine your worth by comparing
yourself with others.
It is because we are different that each of us is special.
Don't set your goals by what other people
deem important.

Only you know what is best for you.
Don't take for granted the things closest to your heart.
Cling to them as you would your life, for without them
life is meaningless.

Don't let your life slip through your fingers
by living in the past or for the future.
By living your life one day at a time,
you live all the days of your life.

Don't give up when you still have something to give.
Nothing is really over until the moment you stop trying.
Don't be afraid to admit that you are less than perfect.
It is this fragile thread that binds us to each other.
Don't be afraid to encounter risks.

It is by taking chances that we learn how to be brave.
Don't shut love out of your life by saying it's impossible to find.
The quickest way to receive love is to give love.
The fastest way to lose love is to hold it too tightly;
and the best way to keep love is to give it wings.
Don't dismiss your dreams.

To be without dreams is to be without hope;
to be without hope is to be without purpose.
Don't run through life so fast that you forget
not only where you've been, but also where you're going.
Life is not a race, but a journey to be savored
each step of the way.

~ Nancye Sims ~ "

Thursday, January 19, 2006

Standard Numeric Format Strings for SQL Reporting Services

Here are the Standard Numeric Format Strings for using in MS SQL Reporting Services.

MS failed to include these with their documentation with the product.

Thursday, January 12, 2006

How to Close All Files Opened by Network Clients from the Command Line

How to Close All Files Opened by Network Clients from the Command Line




Command to Close All Open Files
for /f "skip=4 tokens=1" %a in ('net files') do net files %a /close

The command works by passing the file ID elements from the list produced by the net files command to the action argument of the for command, net files file ID /close. When you use the iterative substitution (%a in this case) as part of a batch file, the substitution needs to be %%a. For the batch file version of the command, use the following syntax:

for /f "skip=4 tokens=1" %%a in ('net files') do net files %%a /close

In both cases, this command will appear to return an error because the last line of output from net files is "The Command Completed Successfully" and there is no file ID denoted as "The".

Note: The Server Service must be running in order for this command to work.