This is my Technical area of troubleshooting and learning new Programming skills and many more. Here you will find answers for many new technologies like asp.net 2.0/3.5,4.0 C# access, mysql, Amazon Webservice ,Sql-server, JD Edwards, SAS, Salesforce, APIs, MVC and many more. please visit & discuss.
Friday, May 30, 2008
HOW TO: Get Started with Microsoft JDBC
MySQL Bugs: #16126: Unable to use MySql as datasource for the ASP.NET 2.0 SqlDataSource object
I tested the code of my first post with the connector 5.0.1 and it works fine.There is another thing that it may be usefull (this is a feature request).With Visual Studio 2005 there are many wizard, one of these is "Connect to datasource"under Tools menu.In this wizard there is the list of data provider registered but MySQL doesn't appear inthe list :(
www.visli.com
MySQL .NET With C# - Lesson 03: Introduction to SQL and ADO.NET
private void cmdLoad_Click(object sender, System.EventArgs e)
{
MySqlConnection conDatabase = new
MySqlConnection("Data Source=localhost;Persist Security Info=yes;");
MySqlCommand cmdDatabase = new MySqlCommand(SQL Code, conDatabase);
conDatabase.Open();
cmdDatabase.ExecuteNonQuery();
conDatabase.Close();
}
www.visli.com
Database Connectivity in C# mySql Database asp.net 2.0
First download connector and copy MySql.Data.dll in bin folder
http://dev.mysql.com/downloads/connector/net/5.1.html
Put
using MySql.Data.MySqlClient;
after that for select from database use following
MySqlDataAdapter myDataAdapter;
string strSQL;
string myConnection = String.Format("server=localhost; user id=dostind; password=123456; database=visli; pooling=false;");
strSQL = "SELECT * FROM UserDetails;";
myDataAdapter = new MySqlDataAdapter(strSQL, myConnection);
DataSet myDataSet = new DataSet();
myDataAdapter.Fill(myDataSet, "UserDetails");
MySQLDataGrid.DataSource = myDataSet;
MySQLDataGrid.DataBind();
for insert/update use following code:
MySqlDataAdapter myDataAdapter;
string strSQL;
string myConnection = String.Format("server=localhost; user id=dostind; password=123456; database=visli; pooling=false;");
strSQL = "insert UserDetails value (4,'test','3','4','5',6)";
myDataAdapter = new MySqlDataAdapter(strSQL, myConnection);
DataSet ds = new DataSet();
myDataAdapter.Fill(ds);
www.visli.com buy online.
Using MySQL database with C# and NET 2.0
How to connect to MySQL 5.0. via C# .Net and the MySql Connector/Net
This article and tutorial describes and demonstrates how you can connect to MySQL in a c# application.
First, you need to install the mysql connector/net, it is located at: http://dev.mysql.com/downloads/connector/net/1.0.html
Next create a new project
Next add reference to: MySql.Data
Next add "using MySql.Data.MySqlClient;"
Finally add the following code to your application:
{
string MyConString = "SERVER=localhost;" +"DATABASE=mydatabase;" +"UID=testuser;" +"PASSWORD=testpassword;";
MySqlConnection connection = new MySqlConnection(MyConString);
MySqlCommand command = connection.CreateCommand();
MySqlDataReader Reader;
command.CommandText = "select * from mycustomers";
connection.Open();
Reader = command.ExecuteReader();
while (Reader.Read())
{
string thisrow = "";
for (int i= 0;i
listBox1.Items.Add(thisrow);
}
connection.Close();
}
www.visli.com
Philips DVDR 3305 won`t finalise disc - Club CDFreaks - Knowledge is Power
There are two options:
1. On older Philips units, the 'force finalise' procedure was this: open the drawer of the recorder and insert the DVD+R disc. Do not close the drawer! Press and hold the '4' button on the remote control of the recorder until the drawer closes. The display should show "Finalize", and after a few minutes it's complete.
2. If you have a PC with DVD rewriter, then you can just write any old short text file to the disc and finalise it with the burning software (eg Nero).
www.visli.com
Thursday, May 29, 2008
How do I password protect my files and folders in Windows?
www.visli.com
ObjectdataSource, SQL-Server and ASP.NET Ajax-Extensions
www.visli.com
Starter Kits and Community Projects : The Official Microsoft ASP.NET Site
Dropdown Box Using AJAX.
www.visli.com
Tool to convert your C# to VB and your VB to C#
www.visli.com
SQL Injection and how to avoid it
The safest way to keep yourself safe from SQL Injection is to always use stored procedures to accept input from user-input variables. It is really simple to do this, for example, this is how you don't want to code things:
e.g.
var Shipcity;
ShipCity = Request.form ("ShipCity");
var sql = "select * from OrdersTable where ShipCity = '" +
ShipCity + "'";
good pratics..
SqlDataAdapter myCommand = new SqlDataAdapter("AuthorLogin", conn);
myCommand.SelectCommand.CommandType = CommandType.StoredProcedure;
SqlParameter parm = myCommand.SelectCommand.Parameters.Add("@au_id", SqlDbType.VarChar, 11);
parm.Value = Login.Text;
http://www.visli.com/
Wednesday, May 28, 2008
CodeProject: Check Validity of Sql Server Stored Procedures/Views/Functions (updated). Free source code and programming help
public class DatabaseValidation
{
[Test]
public void CheckForDatabaseCompilationProblems()
{
Assert.IsTrue(
DatabaseValidator.Validator.DatabaseIsValid(
ConfigurationManager.ConnectionStrings[MyConnectionString].ConnectionString,
DatabaseValidator.Verbosity.Normal),
"Invalid objects found in the database - Run SqlValidator");
}
}
www.svdeals.com
CodeProject: Check Validity of Sql Server Stored Procedures/Views/Functions (updated). Free source code and programming help
public class DatabaseValidation
{
[Test]
public void CheckForDatabaseCompilationProblems()
{
Assert.IsTrue(
DatabaseValidator.Validator.DatabaseIsValid(
ConfigurationManager.ConnectionStrings[MyConnectionString].ConnectionString,
DatabaseValidator.Verbosity.Normal),
"Invalid objects found in the database - Run SqlValidator");
}
}
www.svdeals.com
Tuesday, May 27, 2008
Fixing onhand quantity in F41021 file from Item Ledger F4111 in JD Edwards
first create onhand quantity to update
drop table zdev.dbo.temp_pqoh
SELECT a.LOCN,a.MCU,a.ITM,PQOH,TRQT into zdev.dbo.temp_pqohFROM(SELECT MCU=LTRIM(RTRIM(LIMCU)),ITM=CAST(LIITM as INT),PQOH=SUM(LIPQOH),LOCN=LILOCN FROM JDE_PRODUCTION.PRODDTA.F41021 GROUP BY LIMCU,LILOCN, LIITM) a INNER JOIN (SELECT LOCN=ILLOCN, MCU=LTRIM(RTRIM(ILMCU)),ITM=CAST(ILITM as INT),TRQT=SUM(ILTRQT) FROM JDE_PRODUCTION.PRODDTA.F4111 GROUP BY ILMCU,ILLOCN,ILITM) b ON a.ITM=b.ITM AND a.MCU=b.MCU and a.LOCN=b.LOCN
WHERE PQOH!=TRQT
ORDER BY 1,2
update f41021 table.
UPDATE proddta.f41021 SET lipqoh =trqtfrom proddta.f41021 INNER JOIN zdev.dbo.temp_pqoh on liITM=itm and rtrim(ltrim(limcu))=rtrim(ltrim(mcu)) and lilocn=locnwhere rtrim(ltrim(limcu))=rtrim(ltrim(mcu)) and liITM=itm and lilocn=locn andrtrim(ltrim(limcu))=rtrim(ltrim(mcu)) and lipqoh<>trqt
www.svdeals.com
ASP.NET Running Jobs on SQL Server asp.net
www.visli.com
Monday, May 26, 2008
Delete all duplicate Record from access database
www.svdeals.com
Using MS Access: Multiple updates in one Access SQL statement, access sql, constraint
Sub RunMultiSQL()
DoCmd.SetWarnings False
DoCmd.RunSQL("UPDATE tblYourTable SET Field1='Yes' WHERE Field2 = 'A'")
DoCmd.RunSQL("UPDATE tblYourTable SET Field1='No' WHERE Field3 = 'B'")
DoCmd.SetWarnings True
End Sub
www.svdeals.com
How to create a parameter query in Access 2000
How to Create a Query with One Parameter
loadTOCNode(3, 'summary');
1.
Start Microsoft Access 2000, and then open the sample database Northwind.mdb.
2.
On the View menu, click Database Objects, and then click Queries.
3.
In the Database window, click the Invoices query, and then click Design.
4.
Type the following line in the Criteria cell for the ShipCountry field. Note that the expression that you enter must be enclosed in square brackets.
[View invoices for country]
5.
On the Query menu, click Run. When you are prompted, type UK, and then click OK to view the results of the query. Note that the query returns only those records whose ship country is UK.
6.
Close the query without saving it.
Sunday, May 25, 2008
Mysql SqlDataAdapter getting error - ASP.NET Forums
www.svdeals.com
Saturday, May 24, 2008
Amazon Node List amazon web service
Node 172526 - GPS and Navigation
Node 165796011 - Baby
Node 404272 - VHS
Node 1036592 - Apparel & Accessories
Node 1040668 - Shoes
Node 3367581 - Jewelry & Watches
Node 599858 - Magazines & Newspapers
Node 283155 - Books
Node 5174 - Music
Node 130 - DVD
Node 16261631 - Unbox Video Downloads
Node 468642 - Computer & Video Games
Node 229534 - Software
Node 13993911 - Amazon Shorts
Node 172282 - Electronics
Node 1065836 - Audio & Video
Node 502394 - Camera & Photo
Node 301185 - Cell Phones & Service
Node 541966 - Computers & PC Hardware
Node 1064954 - Office Products
Node 11091801 - Musical Instruments
Node 1055398 - Home & Garden
Node 1057792 - Bed & Bath
Node 1057794 - Furniture & Decor
Node 3370831 - Gourmet Food
Node 284507 - Kitchen & Housewares
Node 286168 - Outdoor Living
Node 12923371 - Pet Supplies
Node 15684181 - Automotive
Node 228013 - Tools & Hardware
Node 16310101 - Grocery
Node 3760911 - Beauty
Node 3760901 - Health & Personal Care
Node 3375251 - Sports & Outdoors
Node 165793011 - Toys & Games
www.svdeals.com
Friday, May 23, 2008
How do I import delimited data into MySQL?
mysql> load data local infile "xxxrs.txt" into table data_table; this work successfully make sure that rs.txt is located at 'MySQL Sverver 6.0\bin'
LOAD DATA LOCAL INFILE '/importfile.csv' INTO TABLE test_table FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (field1, filed2, field3);
http://www.svdeals.com/
MySQL :: MySQL 5.0 Reference Manual :: 12.1.5 CREATE TABLE Syntax
CREATE TABLE NFLSCHOR (
Week nvarchar (255) ,
G0 nvarchar (255) ,
G1 nvarchar (255) ,
G2 nvarchar (255) ,
G3 nvarchar (255) ,
G4 nvarchar (255) ,
G5 nvarchar (255) ,
G6 nvarchar (255) ,
G7 nvarchar (255) ,
G8 nvarchar (255) ,
G9 nvarchar (255) ,
G10 nvarchar (255) ,
G11 nvarchar (255) ,
G12 nvarchar (255) ,
G13 nvarchar (255) ,
G14 nvarchar (255) ,
G15 nvarchar (255) ) ;
www.svdeals.com
Creating a database - mysql
On your command line
create database visli;
show databases;
GRANT ALL ON visli.* TO dostind@localhost IDENTIFIED BY "Password" ;
http://www.visli.com/
Thursday, May 22, 2008
MySQL create user
CREATE USER 'user'@'localhost' IDENTIFIED BY password;
GRANT SELECT,INSERT,UPDATE,DELETE ON *.* TO 'user1'@'localhost';
GRANT ALL ON *.* TO user@'localhost';
www.visli.com
How can I setup a remote connection to MySQL? - MySQL - Web Hosting Knowledge Base
www.visli.com
MySQL 5 C# sample code using ObjectDataSources
www.svdeals.com
Large Binary Data and Blob’s | Development, Analysis And Research
TINYBLOBA BLOB column with a maximum length of 255 (2^8 - 1) bytes. BLOB[(M)]A BLOB column with a maximum length of 65,535 (2^16 - 1) bytes.Beginning with MySQL 4.1, an optional length M can be given. MySQL will create the column as the smallest BLOB type largest enough to hold values M bytes long. MEDIUMBLOBA BLOB column with a maximum length of 16,777,215 (2^24 - 1) bytes. LONGBLOBA BLOB column with a maximum length of 4,294,967,295 or 4GB (2^32 - 1) bytes. Up to MySQL 3.23, the client/server protocol and MyISAM tables had a limit of 16MB per communication packet / table row. From MySQL 4.0, the maximum allowed length of LONGBLOB columns depends on the configured maximum packet size in the client/server protocol and available memory.
www.svdeals.com
How Do I Enable remote access to MySQL database server?
www.svdeals.com
Page 2 - Creating Users and Setting Permissions in MySQL
grant all privileges on brink.* to dostind@"localhost" identified by '123456';
www.visli.com
Wednesday, May 21, 2008
Scrollbar in Gridview
Put your Gridview in the Panel
As far as I know GridView will render as HTML table in the Page and basically using % in setting the Height of the Table will not work in the default DOCTYPE of the aspnet.. In order to recognize the % percent height in the Table then use this doctype below
www.visli.com
Refreshing DataSource Control - CodeSmith Community
www.svdeals.com
making a gridview scroll panel
Place your gridview into a panel. Give Height and width to panel and also set Scroll property of panel.You can also do it with div using position:overflow(not sure).
Tuesday, May 20, 2008
Amazon Webservice - getting result for two pages
Item search is giving you only 1 page (10 product) per page on batch request you can use following to get two pages (20 products)
Distinct on one field - Access Database
www.visli.com
Google Maps Control for ASP.Net
Scrollable Gridview with Freeze header and sort image.
How to Create Xml Poll
Monday, May 19, 2008
Extending ASP.NET DataPager: Creating a google analytics data pager
www.visli.com
Retrieve weekday in words C# asp.net
string dayOfWeek = dt.ToString("dddd");
Response.Write(dayOfWeek);
www.visli.com
C# Google Chart API asp.net
Display google chart on your C# application
1.Down load and build this project on your machine http://googlechartsharp.googlecode.com/files/GoogleChartSharp-1.0.2-source.zip or download this project from this url http://code.google.com/p/googlechartsharp/.
2. Create a new project and copy bin folder of above project.
2. Create image or drag and drop image on your page and name "pictureBox1". (
asp:image id="pictureBox1" runat="server)
3 code Behind
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using GoogleChartSharp;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
pictureBox1.ImageUrl = SimpleGrid();
}
public static string SimpleGrid()
{
// Instantiate the chart object
LineChart lineChart = new LineChart(350, 250);
// Values to be charted
int[] line1 = new int[] { 5, 10, 50, 34, 10, 25, 50, 0 };
// Set chart title using default color and font
lineChart.SetTitle("Step Size Test");
// This is a x and y axis chart. Create two new axis objects
lineChart.AddAxis(new ChartAxis(ChartAxisType.Left));
lineChart.AddAxis(new ChartAxis(ChartAxisType.Bottom));
// Load the chart with the dataset (line int array)
lineChart.SetData(line1);
// Add a grid to the chart (dotted grid lines)
lineChart.SetGrid(20, 50);
// retuns the FQDN of the chart
return lineChart.GetUrl();
}
}
Friday, May 16, 2008
<% if Eval("value") = 0 then%> it's possible? - ASP.NET Forums
Insert data from Amazon new Webservice to access database by node ID
Insert data from Amazon Webservice to access database by node ID after that you can display these data on your webpage, I used C# , asp.net 2.0 , visual stdios 2005 , access , and new amazon webservice .
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml;
using System.Data.OleDb;
public partial class svuploaddata : System.Web.UI.Page
{
public static string SalesRankOut = "";
public static string DetailPageURLOut = "";
public static string imgURLOut = "";
public static string FeatureOut = "";
public static string TitleOut = "";
public static string FormattedPriceOut = "";
protected void Page_Load(object sender, EventArgs e)
{
//detele existing data
deletdatDB();
//Define node by pageno
getNodeItems("551242", "1");
getNodeItems("551242", "2");
getNodeItems("289913","1");
Response.Write("
"+"Process completed"+"
");
}
void getNodeItems(String Nodeno, String ItemPageNo)
{
//get node items
XmlDocument xDoc = new XmlDocument();
xDoc.Load("http://xml-us.amznxslt.com/onca/xml?Service=AWSECommerceService&AssociateTag=wwwvislicom-20&AWSAccessKeyId=16ND0GSSVYMWG9M8ECG2&Operation=ItemSearch&SearchIndex=HomeGarden&BrowseNode=" + Nodeno + "&Version=2006-06-07&ItemPage=" + ItemPageNo + "&ResponseGroup=SalesRank&Sort=salesrank");
// Response.Write("http://xml-us.amznxslt.com/onca/xml?Service=AWSECommerceService&AssociateTag=wwwvislicom-20&AWSAccessKeyId=16ND0GSSVYMWG9M8ECG2&Operation=ItemSearch&SearchIndex=HomeGarden&BrowseNode=" + Nodeno + "&Version=2006-06-07&ItemPage=" + ItemPageNo + "&ResponseGroup=SalesRank&Sort=salesrank");
XmlNodeList Name = xDoc.GetElementsByTagName("ASIN");
int cols = Name.Count;
for (int i = 0; i <= cols - 1; i++)
{
string Xname = Name[i].InnerText;
getItemDetails(Xname);
}
}
//get item deatils..
void getItemDetails(String Itemno)
{
XmlDocument doc = new XmlDocument();
doc.Load("http://xml-us.amznxslt.com/onca/xml?Service=AWSECommerceService&AWSAccessKeyId=xxxxxxxxxxxxxxxxxxxx&Operation=ItemLookup&IdType=ASIN&AssociateTag=wwwvislicom-20&ResponseGroup=Medium&ItemId=" + Itemno);
//Response.Write("http://xml-us.amznxslt.com/onca/xml?Service=AWSECommerceService&AWSAccessKeyId=xxxxxxxxxxxxxxxxxxxx&Operation=ItemLookup&IdType=ASIN&AssociateTag=wwwvislicom-20&ResponseGroup=Medium&ItemId=" + Itemno);
XmlNodeList prodList = doc.GetElementsByTagName("Item");
//SalesRank
{
XmlNodeList SalesRank = doc.GetElementsByTagName("SalesRank");
if (((SalesRank.Count - 1) >= 0))
{
SalesRankOut = SalesRank[0].InnerXml;
}
}
//Title
{
XmlNodeList DetailPageURL = doc.GetElementsByTagName("Title");
if (((DetailPageURL.Count - 1) >= 0))
{
TitleOut = DetailPageURL[0].InnerXml;
}
}
//FormattedPrice
{
XmlNodeList DetailPageURL = doc.GetElementsByTagName("FormattedPrice");
if (((DetailPageURL.Count - 1) >= 0))
{
FormattedPriceOut = DetailPageURL[0].InnerXml;
}
}
//DetailPageURL
{
XmlNodeList DetailPageURL = doc.GetElementsByTagName("DetailPageURL");
if (((DetailPageURL.Count - 1) >= 0))
{
DetailPageURLOut = DetailPageURL[0].InnerXml;
}
}
//image SmallImage
XmlNodeList imgURL = doc.GetElementsByTagName("URL");
if (((imgURL.Count - 1) >= 0))
{
imgURLOut = imgURL[5].InnerXml;
}
//features
int i = 0;
string fFeature1;
string fFeature;
XmlNodeList elemList3 = doc.GetElementsByTagName("Feature");
int tfeature = (elemList3.Count - 1);
if (((elemList3.Count - 1) <= 0))
{
fFeature1 = "";
}
else
{
fFeature1 = ("
for (i = 1; (i <= (elemList3.Count - 1)); i++)
{
fFeature1 = (fFeature1 + ("
FeatureOut = fFeature1;
}
}
/*
Response.Write(SalesRankOut);
Response.Write("
");
Response.Write(DetailPageURLOut);
Response.Write("
");
Response.Write(imgURLOut);
Response.Write("
");
//Response.Write(FeatureOut);
Response.Write("
");
Response.Write(TitleOut);
Response.Write("
");
Response.Write(FormattedPriceOut);
Response.Write("
");
*/
insertdata();
}
void insertdata()
{
string connectionString = "provider=Microsoft.Jet.OLEDB.4.0;data source=c:\\sites\\Single15\\xxxx\\database\\xxxxxxx.mdb";
OleDbConnection myOleDbConnection = new OleDbConnection(connectionString);
OleDbCommand myOleDbCommand = myOleDbConnection.CreateCommand();
string ProdTy = "M2";
System.DateTime today = System.DateTime.Now;
string prodesc = "Sale Price: " + FormattedPriceOut + "
Product Features
" + FeatureOut;
string prodescout = prodesc.Replace("'", "" + (char)146);
string company = "Amazon";
string fut1 = "2";
string ProdDesc;
//string Strsql = "INSERT INTO DetailUrl(NameURL, TextURL,ImageURL,ProdDesc,ComName,ProdType,Price,UpdDate,fut2,fut1)VALUES ('" + DetailPageURLOut + "','" + TitleOut + "','" + imgURLOut + "'," + @ProdDesc + ",'" + company + "','" + ProdTy + "','" + FormattedPriceOut + "','" + today + "','" + fut2 + "','" + fut1 + "' )";
string Strsql = "INSERT INTO svprodtab(NameURL, TextURL,ImageURL,ProdDesc,ComName,ProdType,Price,UpdDate,fut2,fut1)VALUES (@NameURL, @TextURL,@ImageURL,@ProdDesc,@ComName,@ProdType,@Price,@UpdDate,@fut2,@fut1)";
OleDbConnection MyConn = new OleDbConnection(connectionString);
myOleDbCommand.CommandText = Strsql;
OleDbCommand cmd = new OleDbCommand(Strsql, MyConn);
cmd.Parameters.AddWithValue("@NameURL", DetailPageURLOut);
cmd.Parameters.AddWithValue("@TextURL", TitleOut);
cmd.Parameters.AddWithValue("@ImageURL", imgURLOut);
cmd.Parameters.AddWithValue("@ProdDesc", prodesc);
cmd.Parameters.AddWithValue("@ComName", company);
cmd.Parameters.AddWithValue("@ProdType", ProdTy);
cmd.Parameters.AddWithValue("@Price", FormattedPriceOut);
cmd.Parameters.AddWithValue("@UpdDate", System.DateTime.Now);
cmd.Parameters.AddWithValue("@fut2", SalesRankOut);
cmd.Parameters.AddWithValue("@fut1", fut1);
MyConn.Open();
cmd.ExecuteNonQuery();
MyConn.Close();
}
void deletdatDB()
{
string connectionString = "provider=Microsoft.Jet.OLEDB.4.0;data source=c:\\sites\\Single15\\xxxxxx\\database\\xxxxxx.mdb";
OleDbConnection myOleDbConnection = new OleDbConnection(connectionString);
OleDbCommand myOleDbCommand = myOleDbConnection.CreateCommand();
string Strsql = "delete from svprodtab";
OleDbConnection MyConn = new OleDbConnection(connectionString);
myOleDbCommand.CommandText = Strsql;
OleDbCommand cmd = new OleDbCommand(Strsql, MyConn);
MyConn.Open();
cmd.ExecuteNonQuery();
MyConn.Close();
Response.Write("Data Deleted" + "
");
}
}
www.svdeals.com
Thursday, May 15, 2008
global variables in C#
C#:
public class Foo {
public static int Global = 10;
}
http://www.svdeals.com/
Tuesday, May 13, 2008
Select Masterpage and theam during run time asp.net c#
protected void Page_PreInit(object sender, EventArgs e)
{
Page.MasterPageFile = "~/zzzzzz.master";
}
Schemaless C#-XML data binding with VTD-XML
www.visli.com
Agochar Keypad - A Virtual Keyboard in Hindi
www.svdeals.com
GridView Custom Paging with PageSize Change Dropdown
www.svdeals.com
Expanding / Collapsing GridView Rows
www.visli.com
Monday, May 12, 2008
Friday, May 9, 2008
How to Buy a Digital Photo Frame - Reviews by PC Magazine
www.visli.com
How to increase the time out for request/response ? - ASP.NET Forums
See http://msdn2.microsoft.com/en-us/library/e1f13641.aspx for more details.
www.visli.com
SQL Server Update: "Using CASE Expressions"
select mcco sdkcoo,imlitm sdlitm ,imdsc1 sddsc1,limcu sdmcu,rtrim(wwgnnm)+' '+ltrim(wwsrnm) OwnerName, rtrim(wpar1)+' '+ltrim(wpph1) phoneNo,sum(lipqoh)lipqoh,sum(sdsoqs)sdsoqs,wk1 = CASE WHEN sdtrdj=108110 then sum(sdsoqs) end, wk2 = CASE WHEN sdtrdj=108117 then sum(sdsoqs) end, wk3 = CASE WHEN sdtrdj=108121 then sum(sdsoqs) end, sdsrp1,sdsrp2,sdsrp3,sdsrp4,sdsrp5,sdprp1,sdprp2--into #temp_sales1from vItemdetail nolockleft outer join jde_cccccc.ccccc.f4211 on sditm=liitm and sdmcu=limcu and sddcto in ('SF','SI','SO')where mcco=870 and lipqoh<>0-- and ((@mcu is null) or (ltrim(limcu)=ltrim(@mcu))) group by mcco,imlitm,imdsc1,limcu,sdsrp1,sdsrp2,sdsrp3,sdsrp4,sdsrp5,sdprp1,sdprp2,wwsrnm,wwgnnm,wpar1,wpph1,sdtrdj
http://www.svdeals.com/
Thursday, May 8, 2008
total in datagrid footer
http://msdn.microsoft.com/en-us/library/ms972833.aspx
int onhandqty = 0;
int quantityTotal = 0;
int wk1qtyTot = 0;
int wk2qtyTot = 0;
int wk3qtyTot = 0;
protected void productsGridView_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
// add the UnitPrice and QuantityTotal to the running total variables
onhandqty += Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "On Hand Qty"));
quantityTotal += Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "Ship Qty"));
wk1qtyTot += Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "Week1"));
wk2qtyTot += Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "Week2"));
wk3qtyTot += Convert.ToInt32(DataBinder.Eval(e.Row.DataItem, "Week3"));
}
else if (e.Row.RowType == DataControlRowType.Footer)
{
e.Row.Cells[5].Text = "Totals:";
// for the Footer, display the running totals
e.Row.Cells[6].Text = onhandqty.ToString("d");
e.Row.Cells[7].Text = quantityTotal.ToString("d");
e.Row.Cells[8].Text = wk1qtyTot.ToString("d");
e.Row.Cells[9].Text = wk2qtyTot.ToString("d");
e.Row.Cells[10].Text = wk3qtyTot.ToString("d");
e.Row.Cells[5].HorizontalAlign = e.Row.Cells[2].HorizontalAlign = HorizontalAlign.Left;
e.Row.Font.Bold = true;
}
Gridview Fixed Header Issue
Freeze Header:1. Define class .Freezing in Stylesheet:
.Freezing {
position:relative ;
top:expression(this.offsetParent.scrollTop);
z-index: 10; }
2. Assign Datagrid Header's cssClass to Freezing
3. You are done!
www.svdeals.com
How to clear a gridview? - ASP.NET Forums
GridView1.DataSource = ""
GridView1.DataBind()
www.svdeals.com
CodeProject: Developing a Realtime Stockreader using WPF and Yahoo Finance Data. Free source code and programming help
www.svdeals.com
CodeProject: GridView Rows Navigation Using The Arrow (Up/Down) Keys.. Free source code and programming help
www.svdeals.com
Wednesday, May 7, 2008
passing multiple parameters to stored procedure - DevX.com Forums
Optional Parameters in SQL Stored Procedures
CREATE PROCEDURE TestProc
( @Param1 varchar(50) = NULL,
@Param2 varchar(50) = NULL,
@Param3 varchar(50) = NULL)AS
SELECT *
FROM TestTable
WHERE ((@Param1 IS NULL) OR (col1 = @Param1)) AND ((@Param2 IS NULL) OR (col2 = @Param2)) AND ((@Param3 IS NULL) OR (col3 = @Param3))
Results in:
exec TestProc
exec TestProc I
exec TestProc I, Love
exec TestProc I, Love, SPROCs
www.visli.com
Temporary Tables - MS SQL Server
Open one session in Query Analyzer or SSMS (Management Studio) and create a temporary table as shown below.
CREATE TABLE #TEMP
(
COL1 INT,
COL2 VARCHAR(30),
COL3 DATETIME DEFAULT GETDATE()
)GO
Tuesday, May 6, 2008
SQL CASE WHEN
Select Case Hour(Now())
Case 0
'Do whatever needs to be done at midnight
Case 1
'Do whatever needs to be done at 1:00 am
Case 2
'do
else
'do this
End Select
Monday, May 5, 2008
Forcing browser to reload the "same page" with "mapped URL" in ASP.net
A Look at ASP.NET 2.0's URL Mapping
We can use ASP.NET 2.0's URL mapping feature to provide a friendly URL, like ~/Beverages.aspx. The following
...
...
mappedUrl="~/ProductsByCategory.aspx?CategoryID=1&CategoryName=Beverages" />
mappedUrl="~/ProductsByCategory.aspx?CategoryID=2&CategoryName=Condiments" />
mappedUrl="~/ProductsByCategory.aspx?CategoryID=3&CategoryName=Confections" />
mappedUrl="~/ProductsByCategory.aspx?CategoryID=4&CategoryName=Dairy+Products" />
mappedUrl="~/ProductsByCategory.aspx?CategoryID=5&CategoryName=Grains+and+Cereals" />
mappedUrl="~/ProductsByCategory.aspx?CategoryID=6&CategoryName=Meat+and+Poultry" />
mappedUrl="~/ProductsByCategory.aspx?CategoryID=7&CategoryName=Produce" />
mappedUrl="~/ProductsByCategory.aspx?CategoryID=8&CategoryName=Seafood" />
SiteProNews: How to Optimize for Google: Part 1 of 3
www.visli.com
Saturday, May 3, 2008
Using Windows Vista System Restore :: the How-To Geek
There are two places that you can use the system restore feature from. From within Windows, you can just type restore into the Start menu search box, and you'll immediately see System Restore at the top of the start menu:
you can type rstrui into the search box and hit enter.
www.visli.com
Friday, May 2, 2008
Fullscreen not working on flash sites, e.g. youtube, etc?
2. Choose 'Settings...' from the Flash Player's pop-up menu.
4. click on first computer photo with brush.
3. Uncheck the 'Enable Hardware Acceleration'
4. Click 'Close'.
video being watched right now - YouTube APIs and Tools Discussion
There currently isn't the ability to retrieve the "videos being watched now" from the API.
video being watched right now - YouTube APIs and Tools Discussion
There currently isn't the ability to retrieve the "videos being watched now" from the API.
Thursday, May 1, 2008
Developer's Guide: .NET - Google Documents List Data API - Google Code
Contents
Audience
Getting started
Authenticating to the Documents service
Single-user "installed" client authentication
Multiple-user web application client authentication
Retrieving a list of documents
Uploading documents
Uploading a word processor document
Uploading a spreadsheet
Uploading a presentation
Trashing a document
Searching the documents feed
Retrieving all word processor documents
Retrieving all spreadsheets
Retrieving all starred presentations
Retrieving a document by an exact title match
Retrieving all documents in a named folder
Performing a text query
www.svdeals.com