Old Method:
if(null != id && 0 != id.length)
{
}
New:-
if(!String.IsNullOrEmpty(id))
{
}
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.
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;public
partial class tstamz : System.Web.UI.Page{
string SalesRankOut; protected void Page_Load(object sender, EventArgs e){
getItemDetails();
}
void getItemDetails(){
//ItemnoCnt = Itemno; XmlDocument doc = new XmlDocument();doc.Load(
"http://xml-us.amznxslt.com/onca/xml?Service=AWSECommerceService&AWSAccessKeyId=16ND0GSSVYMWG9M8ECG2&Operation=ItemLookup&IdType=ASIN&AssociateTag=wwwvislicom-20&ResponseGroup=Large,Offers&ItemId=B0018OKX68"); XmlNodeList lstIsValid = doc.GetElementsByTagName("IsValid"); if (lstIsValid.Count > 0 && lstIsValid[0].InnerXml == "True"){
XmlNodeList lstItems = doc.GetElementsByTagName("Item"); if (lstItems.Count > 0){
XmlNode nItem = lstItems[0]; foreach (XmlNode nChild in nItem.ChildNodes){
if (nChild.Name == "DetailPageURL") //string compare !{
String strURL = nChild.InnerXml; //our data !}
else if (nChild.Name == "LargeImage"){
foreach (XmlNode nURLImg in nChild.ChildNodes){
if (nURLImg.Name == "URL"){
string strImage = nChild.InnerXml; //our data !Response.Write(nChild.FirstChild.InnerText);
Label1.Text =
"<img src=" + nChild.FirstChild.InnerText + "></img>"; // Response.Write("<br>"); //Response.Write(nChild.LastChild.InnerText);}
}
}
else if (nChild.Name == "ItemAttributes"){
foreach (XmlNode nIA in nChild.ChildNodes){
//Look through each "ItemAttributes" to find the one //we want again if (nIA.Name == "Title"){
String strTitle = nIA.InnerXml; //our data !Response.Write(
"<li>Title:--- " + strTitle + "</li> ");}
if (nIA.Name == "Feature"){
String strFeature = nIA.InnerXml; //our data !Response.Write(
"<li> " + strFeature + "</li> ");}
}
}
else if (nChild.Name == "OfferSummary"){
foreach (XmlNode nOS in nChild.ChildNodes){
//looking again if (nOS.Name == "LowestNewPrice"){
foreach (XmlNode nLNP in nOS.ChildNodes){
if (nLNP.Name == "FormattedPrice"){
Response.Write(
"strPrice"); String strPrice = nLNP.InnerXml; //our data ! break; //done looking here.}
}
}
}
}
else if (nChild.Name == "EditorialReviews"){
foreach (XmlNode nCR in nChild.ChildNodes){
foreach (XmlNode nRev in nCR.ChildNodes){
if (nRev.Name == "Content"){
Response.Write(
"<br> Description:");Response.Write(nRev.InnerXml);
//Our review text! string strReview = nRev.InnerXml;}
}
}
}
}
}
}
}
}
<
clear /><
add name="ConnectionString" connectionString="Data Source=SERVERNAME;Initial Catalog=DATABASE;User ID=USER" providerName="System.Data.SqlClient"/>cursor style hand not working on gridview at firefox
in your stylesheet use
cursor:pointer;
Fixed-length Unicode character data of n characters. n must be a value from 1 through 4,000. The storage size is two times n bytes. The ISO synonyms for nchar are national char and national character.
Variable-length Unicode character data. n can be a value from 1 through 4,000. max indicates that the maximum storage size is 2^31-1 bytes. The storage size, in bytes, is two times the number of characters entered + 2 bytes. The data entered can be 0 characters in length. The ISO synonyms for nvarchar are national char varying and national character varying.
create procedure dbo.GetEmployees
As
select e.employeeid, e.title, c.FirstName + ' ' + c.Lastname As Fullname from HumanResources.employee e
inner join person.contact c
on e.contactid = c.contactid
go
CREATE ENDPOINT GetEmployees
STATE = STARTED
AS HTTP
(
PATH = '/Employee',
AUTHENTICATION = (INTEGRATED),
PORTS = (CLEAR),
SITE = 'localhost'
)
FOR SOAP
(
WEBMETHOD 'EmployeeList'
(NAME='AdventureWorks.dbo.GetEmployees'),
BATCHES = DISABLED,
WSDL = DEFAULT,
DATABASE = 'AdventureWorks',
NAMESPACE = 'http://AdventureWorks/Employee'
)
A VB.net form that loads the results of the stored procedure into a list box.
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' Create a new instance of the web service
Dim employeesProxy As adventureWorksService.GetEmployees = New adventureWorksService.GetEmployees
' You have to pass in credentials to authenticate yourself to use the service. We are just going to use
' the same credentials we have logged into our computer as.
employeesProxy.Credentials = System.Net.CredentialCache.DefaultCredentials
' The result of a SELECT statement via an endpoint can be converted to a DataSet
Dim ds As System.Data.DataSet = DirectCast(employeesProxy.EmployeeList, DataSet)
ListBox1.DataSource = ds.Tables(0)
ListBox1.DisplayMember = "FullName"
ListBox1.ValueMember = "EmployeeId"
End Sub
End Class
mysql> SELECT DATE_ADD('2008-01-02', INTERVAL 31 DAY);
-> '2009-02-02'
mysql> SELECT ADDDATE('2009-01-02', INTERVAL 31 DAY);
-> '2009-02-02'
mysql> SELECT ADDTIME('2007-12-31 23:59:59.999999', '1 1:1:1.000002');
-> '2009-01-02 01:01:01.000001'
mysql> SELECT ADDTIME('01:00:00.999999', '02:00:00.999998');
-> '03:00:01.999997'
mysql> SELECT CONVERT_TZ('2004-01-01 12:00:00','GMT','MET');
-> '2004-01-01 13:00:00'
mysql> SELECT CONVERT_TZ('2004-01-01 12:00:00','+00:00','+10:00');
-> '2004-01-01 22:00:00'
mysql> SELECT CURDATE();
-> '2009-06-13'
mysql> SELECT CURDATE() + 0;
-> 20090613
mysql> SELECT CURTIME();
-> '23:50:26'
mysql> SELECT CURTIME() + 0;
-> 235026.000000
mysql> SELECT DATE('2005-12-31 01:02:03');
-> '2005-12-31'
mysql> SELECT DATEDIFF('2007-12-31 23:59:59','2007-12-30');
-> 1
mysql> SELECT DATEDIFF('2010-11-30 23:59:59','2010-12-31');
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.Data.OleDb;
public partial class signon : System.Web.UI.Page
{
string CaseIDClient;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
{
bool Authenticated = false;
Authenticated =
SiteLevelCustomAuthenticationMethod(Login1.UserName, Login1.Password);
e.Authenticated = Authenticated;
if (Authenticated == true)
{
Response.Redirect("Default.aspx");
}
}
private bool SiteLevelCustomAuthenticationMethod(string UserName,
string Password)
{
OleDbConnection conDatabase = null;
OleDbDataReader Dr = null;
bool boolReturnValue = false;
string strUserID = UserName;
conDatabase = new
OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=c:\\sites\\Single15\\visli\\database\\H4rDB.mdb");
conDatabase.Open();
string strSQL = "select * from USERS where USERID=\'" +
(strUserID + "\'");
OleDbCommand cmdDatabase = new OleDbCommand(strSQL, conDatabase);
Dr = cmdDatabase.ExecuteReader();
while (Dr.Read())
{
string UserNameDB = Dr["USERID"].ToString();
string PasswordDB = Dr["PASSWORD"].ToString();
string userbranchDB = Dr["USERBRANCH"].ToString();
string userRoleDB = Dr["ROLE"].ToString();
if ((UserName == UserNameDB.TrimEnd().TrimStart()) &
(Password == PasswordDB.TrimEnd().TrimStart()))
{
Session["loginm"] = strUserID;
Session["userRole"] = userRoleDB;
Session["userBranch"] = userbranchDB;
Session["BRANCH"] = userbranchDB;
Session["CaseIDClient"] = Dr["CASENO"];
boolReturnValue = true;
break;
}
}
conDatabase.Close();
Dr.Close();
return boolReturnValue;
}
}
Hide and Show table asp.net c# 2.0 3.5