Friday, May 30, 2008

HOW TO: Get Started with Microsoft JDBC

HOW TO: Get Started with Microsoft JDBC: "HOW TO: Get Started with Microsoft JDBC"

MySQL Bugs: #16126: Unable to use MySql as datasource for the ASP.NET 2.0 SqlDataSource object

MySQL Bugs: #16126: Unable to use MySql as datasource for the ASP.NET 2.0 SqlDataSource object: "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

MySQL .NET With C# - Lesson 03: Introduction to SQL and ADO.NET: "MySqlCommand"



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

Using MySQL database with C# and NET 2.0: "Using MySQL with .NET Application"

How to connect to MySQL 5.0. via C# .Net and the MySql Connector/Net

How to connect to MySQL 5.0 using c# and mysql connector/net!: "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;ithisrow+=Reader.GetValue(i).ToString() + ",";
listBox1.Items.Add(thisrow);
}
connection.Close();
}

www.visli.com

Philips DVDR 3305 won`t finalise disc - Club CDFreaks - Knowledge is Power

Philips DVDR 3305 won`t finalise disc - Club CDFreaks - Knowledge is Power: "Philips DVDR 3305 won`t finalise disc"


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?

How do I password protect my files and folders in Windows?: "How do I password protect my files and folders in Windows?"


www.visli.com

ObjectdataSource, SQL-Server and ASP.NET Ajax-Extensions

ObjectdataSource, SQL-Server and ASP.NET Ajax-Extensions: "ObjectdataSource, SQL-Server and ASP.NET Ajax-Extensions"

www.visli.com

ASP.NET AJAX meets Virtual Earth

ASP.NET AJAX meets Virtual Earth – Part Four


www.visli.com

Starter Kits and Community Projects : The Official Microsoft ASP.NET Site

Starter Kits and Community Projects : The Official Microsoft ASP.NET Site: "Starter Kits and Community Projects"

Managing Configuration Data Programmatically in ASP.NET 2.0

Managing Configuration Data Programmatically in ASP.NET 2.0: ASP Alliance

www.visli.com

Dropdown Box Using AJAX.

CodeProject: Dropdown Box Using AJAX. Free source code and programming help: "Dropdown Box Using AJAX"


www.visli.com

Getting Started with the ListView Control

http://www.gridviewguy.com/ArticleDetails.aspx?articleID=396_Getting_Started_With_The_ListView_Control

Tool to convert your C# to VB and your VB to C#

Tool to convert your C# to VB and your VB to C#: "Tool to convert your C# to VB and your VB to C#"


www.visli.com

SQL Injection and how to avoid it

ASP.NET Debugging : SQL Injection and how to avoid it: "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

CodeProject: Check Validity of Sql Server Stored Procedures/Views/Functions (updated). Free source code and programming help: "Check Validity of Sql Server Stored Procedures/Views/Functions (updated)"


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

CodeProject: Check Validity of Sql Server Stored Procedures/Views/Functions (updated). Free source code and programming help: "Check Validity of Sql Server Stored Procedures/Views/Functions (updated)"


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: Event Calendar [ ASP.NET 2.0 / C# ]. Free source code and programming help

CodeProject: Event Calendar [ ASP.NET 2.0 / C# ]. Free source code and programming help: "Event Calendar [ ASP.NET 2.0 / C# ]"


http://www.svdeals.com/

Tuesday, May 27, 2008

ColorBar - A Gradient Colored ProgressBar

CodeProject: ColorBar - A Gradient Colored ProgressBar. Free source code and programming help

www.svdeals.com

.NET Role-Based Security in a Production Environment

CodeProject: .NET Role-Based Security in a Production Environment. Free source code and programming help


www.svdeals.com

Office Web Component v11.0 Spreadsheet And AJAX Interoperatibility Part 1

CodeProject: Office Web Component v11.0 Spreadsheet And AJAX Interoperatibility Part 1. Free source code and programming help


www.visli.com

A Chat with ASP.NET and Ajax.

CodeProject: A Chat with ASP.NET and Ajax. Free source code and programming help: "Chat with ASP.NET and Ajax"


http://www.visli.com/

Fixing onhand quantity in F41021 file from Item Ledger F4111 in JD Edwards

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

DotASPX.Net - ASP.NET Running Jobs on SQL Server: "RUNNING JOBS ON SQL SERVER - OVERVIEW:"



www.visli.com

Monday, May 26, 2008

Freeze ASP.NET GridView Headers by Creating Client-Side Extenders - Dan Wahlin's WebLog

Freeze ASP.NET GridView Headers by Creating Client-Side Extenders - Dan Wahlin's WebLog

Delete all duplicate Record from access database

DELETE *FROM svprodtabWHERE itmno in(SELECT [Itmno]FROM svprodtabGROUP BY [Itmno]HAVING count(Itmno)>1ORDER BY [Itmno]);
www.svdeals.com

Using MS Access: Multiple updates in one Access SQL statement, access sql, constraint

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 parameter query in Access 2000: "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.

Saturday, May 24, 2008

Amazon Node List amazon web service

Node 16310091 - Industrial &; Scientific
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?

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

MySQL :: MySQL 5.0 Reference Manual :: 12.1.5 CREATE TABLE Syntax: "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

mysql primer - creating a database - mysql create database command - mysql show databases command: "Creating MySQL database on Windows system"


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

MySQL create user: "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

Excel: Transpose Function

Excel: Transpose Function: "Excel: Transpose Function"

How can I setup a remote connection to MySQL? - MySQL - Web Hosting Knowledge Base

How can I setup a remote connection to MySQL? - MySQL - Web Hosting Knowledge Base: "How can I setup a remote connection to MySQL?"

www.visli.com

Download mysql connector net 5.1.6

MySQL :: Select a Mirror

MySQL 5 C# sample code using ObjectDataSources

CodeProject: MySQL 5 C# sample code using ObjectDataSources. Free source code and programming help: "MySQL 5 C# sample code using ObjectDataSources"

www.svdeals.com

Large Binary Data and Blob’s | Development, Analysis And Research

Large Binary Data and Blob’s Development, Analysis And Research: "Large Binary Data and Blob’s"


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?

How Do I Enable remote access to MySQL database server?: "How Do I Enable remote access to MySQL database server?"


www.svdeals.com

Page 2 - Creating Users and Setting Permissions in MySQL

Page 2 - Creating Users and Setting Permissions in MySQL: "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

CodeProject: Storing Images in MySQL using ASP.NET. Free source code and programming help

CodeProject: Storing Images in MySQL using ASP.NET. Free source code and programming help: "Storing Images in MySQL using ASP.NET"

Scrollbar in Gridview

Scrollbar in Gridview - ASP.NET Forums: "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

Refreshing DataSource Control - CodeSmith Community: "Refreshing DataSource Control Refreshing DataSource Control"


www.svdeals.com

Substring C# xpath

<%#XPath("link").ToString().Substring(("link").ToString().Length-4,67)%>

www.visli.com

making a gridview scroll panel

making a gridview scroll: "making a gridview scroll"

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)

http://xml-us.amznxslt.com/onca/xml?Service=AWSECommerceService&AssociateTag=wwwvislicom-20&AWSAccessKeyId=16ND0GSSVYMWG9M8ECG2&Operation=ItemSearch&SearchIndex=Apparel&BrowseNode=1036682&Version=2006-06-07&ItemSearch.1.BrowseNode=1036682&ResponseGroup=Large,SalesRank,Offers,Variations&ItemSearch.1.Itempage=1&ItemSearch.2.ItemPage=2&Style=http://www.visli.com/amazWeb.xsl&Sort=salesrank

Distinct on one field - Access Database

SELECT T1.*FROM MyTable AS T1WHERE T1.email IN (SELECT T2.email FROM MyTable AS T2 GROUP BY T2.email HAVING COUNT(T2.email)=1 );


www.visli.com

Google Maps Control for ASP.Net

CodeProject: Google Maps Control for ASP.Net - Part 1. Free source code and programming help: "Google Maps Control for ASP.Net - Part 1"

Problem with Response.Write - Changing Dynamic Contents without Corruption

CodeProject: Problem with Response.Write - Changing Dynamic Contents without Corruption. Free source code and programming help

Scrollable Gridview with Freeze header and sort image.

CodeProject: Scrollable Gridview with Freeze header and sort image.. Free source code and programming help: "Scrollable Gridview with Freeze header and sort image."

How to Create Xml Poll

CodeProject: How to Create Xml Poll. Free source code and programming help: "How to Create Xml Poll"

DataGridViewColumn Hosting MaskedTextBox

CodeProject: DataGridViewColumn Hosting MaskedTextBox. Free source code and programming help


www.visli.com

Monday, May 19, 2008

Extending ASP.NET DataPager: Creating a google analytics data pager

Extending ASP.NET DataPager: Creating a google analytics data pager: "Extending DataPager: Creating a google analytics data pager"


www.visli.com

Retrieve weekday in words C# asp.net

DateTime dt = DateTime.Now;
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();
}
}

http://www.svdeals.com/

PictureBox Class (System.Windows.Forms)

PictureBox Class (System.Windows.Forms): "PictureBox Class"

string (C#)

string (C#)

Friday, May 16, 2008

CodeProject: Slide Show - New, Improved. Free source code and programming help

CodeProject: Slide Show - New, Improved. Free source code and programming help: "Slide Show - New, Improved"


http://www.visli.com/

<% if Eval("value") = 0 then%> it's possible? - ASP.NET Forums

<% if Eval("value") = 0 then%> it's possible? - ASP.NET Forums: "<% if Eval('value') = 0 then%> it's possible?"

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 = ("

  • " + elemList3[0].InnerXml);
    for (i = 1; (i <= (elemList3.Count - 1)); i++)
    {
    fFeature1 = (fFeature1 + ("
  • " + elemList3[i].InnerXml));
    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



  • Friday, May 9, 2008

    How to Buy a Digital Photo Frame - Reviews by PC Magazine

    How to Buy a Digital Photo Frame - Reviews by PC Magazine: "How to Buy a Digital Photo Frame"

    www.visli.com

    rpad or right pad in sql-server

    set @kcoo=right(replicate('0',3)+ cast(rtrim(@kcoo) as varchar),5)

    Validation in ASP.NET 2.0

    Validation in ASP.NET 2.0: "Validation in ASP.NET 2.0"

    www.svdeals.com

    How to increase the time out for request/response ? - ASP.NET Forums

    How to increase the time out for request/response ? - ASP.NET Forums: "How to increase the time out for request/response ?"






    See http://msdn2.microsoft.com/en-us/library/e1f13641.aspx for more details.


    www.visli.com

    SQL Server Update: "Using CASE Expressions"

    SQL Server Update: "Using CASE Expressions": "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;
    }

    www.visli.com

    Gridview Fixed Header Issue

    Gridview Fixed Header Issue - ASP.NET Forums: "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

    How to clear a gridview? - ASP.NET Forums: "How to clear a gridview?"

    GridView1.DataSource = ""
    GridView1.DataBind()

    www.svdeals.com

    CodeProject: Multiple Ways to do Multiple Inserts. Free source code and programming help

    CodeProject: Multiple Ways to do Multiple Inserts. Free source code and programming help: "Multiple Ways to do Multiple Inserts"

    www.svdeals.com

    CodeProject: Developing a Realtime Stockreader using WPF and Yahoo Finance Data. Free source code and programming help

    CodeProject: Developing a Realtime Stockreader using WPF and Yahoo Finance Data. Free source code and programming help: "Developing a Realtime Stockreader using WPF and Yahoo Finance Data"


    www.svdeals.com

    CodeProject: GridView Rows Navigation Using The Arrow (Up/Down) Keys.. Free source code and programming help

    CodeProject: GridView Rows Navigation Using The Arrow (Up/Down) Keys.. Free source code and programming help: "GridView Rows Navigation Using The Arrow (Up/Down) Keys."


    www.svdeals.com

    CodeProject: Localizing Date and Time Display in ASP.NET. Free source code and programming help

    CodeProject: Localizing Date and Time Display in ASP.NET. Free source code and programming help: "Localizing Date and Time Display in ASP.NET"


    www.svdeals.com

    Wednesday, May 7, 2008

    passing multiple parameters to stored procedure - DevX.com Forums

    passing multiple parameters to stored procedure - DevX.com Forums: "passing multiple parameters to stored procedure"

    Optional Parameters in SQL Stored Procedures

    Optional Parameters in SQL Stored Procedures - Robert McLaws: FunWithCoding.NET: "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

    Temporary Tables - MS SQL Server « Systems Engineering and RDBMS: "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 BETWEEN

    SELECT "column_name"FROM "table_name"WHERE "column_name"
    BETWEEN 'value1' AND 'value2'

    www.visli.com

    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

    URL Rewriting in ASP.NET

    URL Rewriting in ASP.NET: "URL Rewriting in ASP.NET"

    Forcing browser to reload the "same page" with "mapped URL" in ASP.net

    Forcing browser to reload the "same page" with "mapped URL" in ASP.net: "Forcing browser to reload the 'same page' with 'mapped URL' in ASP.net"

    A Look at ASP.NET 2.0's URL Mapping

    4GuysFromRolla.com: "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 element markup provides eight mappings, creating a friendly URL for each of the categories in the Northwind database's Categories table. With these mappings in place, a user can view the products in the Beverages category by visiting either ~/ProductsByCategory.aspx?CategoryID=1&CategoryName=Beverages or ~/Beverages.aspx.


    ...

    ...


    url="~/Beverages.aspx"
    mappedUrl="~/ProductsByCategory.aspx?CategoryID=1&CategoryName=Beverages" />
    url="~/Condiments.aspx"
    mappedUrl="~/ProductsByCategory.aspx?CategoryID=2&CategoryName=Condiments" />
    url="~/Confections.aspx"
    mappedUrl="~/ProductsByCategory.aspx?CategoryID=3&CategoryName=Confections" />
    url="~/Dairy.aspx"
    mappedUrl="~/ProductsByCategory.aspx?CategoryID=4&CategoryName=Dairy+Products" />
    url="~/Grains.aspx"
    mappedUrl="~/ProductsByCategory.aspx?CategoryID=5&CategoryName=Grains+and+Cereals" />
    url="~/Meat.aspx"
    mappedUrl="~/ProductsByCategory.aspx?CategoryID=6&CategoryName=Meat+and+Poultry" />
    url="~/Produce.aspx"
    mappedUrl="~/ProductsByCategory.aspx?CategoryID=7&CategoryName=Produce" />
    url="~/Seafood.aspx"
    mappedUrl="~/ProductsByCategory.aspx?CategoryID=8&CategoryName=Seafood" />


    SiteProNews: How to Optimize for Google: Part 1 of 3

    SiteProNews: How to Optimize for Google: Part 1 of 3: "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

    Using Windows Vista System Restore :: the How-To Geek: "Using System Restore in Windows"

    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?

    1. Right-click in the standard youtube video window (non-fullscreen).
    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'.

    Bounce Rate - Wikipedia, the free encyclopedia

    Bounce Rate - Wikipedia, the free encyclopedia: "Bounce Rate"

    video being watched right now - YouTube APIs and Tools Discussion

    video being watched right now - YouTube APIs and Tools Discussion Google Groups: "video being watched right now"

    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

    video being watched right now - YouTube APIs and Tools Discussion Google Groups: "video being watched right now"

    There currently isn't the ability to retrieve the "videos being watched now" from the API.