Click here to Skip to main content
15,908,111 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralHelp on people posting comments on my website [Moved] Pin
T. Cody23-Jul-09 14:59
T. Cody23-Jul-09 14:59 
GeneralRe: Help on people posting comments on my website Pin
Richard Andrew x6423-Jul-09 15:06
professionalRichard Andrew x6423-Jul-09 15:06 
GeneralRe: Help on people posting comments on my website Pin
T. Cody23-Jul-09 15:09
T. Cody23-Jul-09 15:09 
GeneralRe: Help on people posting comments on my website Pin
Richard Andrew x6423-Jul-09 15:11
professionalRichard Andrew x6423-Jul-09 15:11 
GeneralRe: Help on people posting comments on my website Pin
CaptainSeeSharp23-Jul-09 15:40
CaptainSeeSharp23-Jul-09 15:40 
Questionurgent help needed asp.net C# code error [modified] Pin
solo_gaurav23-Jul-09 10:20
solo_gaurav23-Jul-09 10:20 
AnswerRe: urgent help needed asp.net C# code error Pin
Abhijit Jana23-Jul-09 10:22
professionalAbhijit Jana23-Jul-09 10:22 
AnswerRe: urgent help needed asp.net C# code error Pin
solo_gaurav23-Jul-09 10:53
solo_gaurav23-Jul-09 10:53 
namespace System.Web.UI.DataVisualization.Charting.Samples
{
///
/// Summary description for ImageMapCustom.
///
public partial class DataBindSeriesByRows : System.Web.UI.Page
{

protected void Page_Load(object sender, System.EventArgs e)
{
// resolve the address to the Access database
//string fileNameString = this.MapPath(".");
///fileNameString += "..\\..\\..\\..\\data\\chartdata.mdb";

// initialize a connection string
string myConnectionString = "Provider=SQLNCLI.1;Data Source=.;Integrated Security=SSPI;Initial Catalog=abc";

// define the database query
string mySelectQuery="SELECT * FROM SALESCOUNTS;";

// create a database connection object using the connection string
OleDbConnection myConnection = new OleDbConnection(myConnectionString);

// create a database command on the connection using query
OleDbCommand myCommand = new OleDbCommand(mySelectQuery, myConnection);

// open the connection
myCommand.Connection.Open();

// Initializes a new instance of the OleDbDataAdapter class
OleDbDataAdapter myDataAdapter = new OleDbDataAdapter();
myDataAdapter.SelectCommand = myCommand;

// Initializes a new instance of the DataSet class
DataSet myDataSet = new DataSet();

// Adds rows in the DataSet
myDataAdapter.Fill(myDataSet, "Query");


foreach(DataRow row in myDataSet.Tables["Query"].Rows)
{
// for each Row, add a new series
string seriesName = row["SalesRep"].ToString();
Chart1.Series.Add(seriesName);
Chart1.Series[seriesName].ChartType = SeriesChartType.Line;
Chart1.Series[seriesName].BorderWidth = 2;
Chart1.Series[seriesName].ShadowOffset = 2;


for(int colIndex = 1; colIndex < myDataSet.Tables["Query"].Columns.Count; colIndex++)
{
// for each column (column 1 and onward), add the value as a point
string columnName = myDataSet.Tables["Query"].Columns[colIndex].ColumnName;
int YVal = (int) row[columnName];////// ERRROR IN THIS LINE

Chart1.Series[seriesName].Points.AddXY(columnName, YVal);
}
}

DataGrid.DataSource = myDataSet;
DataGrid.DataBind();

// Closes the connection to the data source. This is the preferred
// method of closing any open connection.
myCommand.Connection.Close();

}

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{

}
#endregion


}
}

is this thing you want....proper format i think
GeneralRe: urgent help needed asp.net C# code error Pin
Abhijit Jana23-Jul-09 10:57
professionalAbhijit Jana23-Jul-09 10:57 
GeneralRe: urgent help needed asp.net C# code error Pin
solo_gaurav23-Jul-09 11:05
solo_gaurav23-Jul-09 11:05 
GeneralRe: urgent help needed asp.net C# code error Pin
Abhijit Jana23-Jul-09 11:26
professionalAbhijit Jana23-Jul-09 11:26 
GeneralRe: urgent help needed asp.net C# code error Pin
PDTUM23-Jul-09 11:36
PDTUM23-Jul-09 11:36 
AnswerRe: urgent help needed asp.net C# code error [modified] Pin
Abhijit Jana23-Jul-09 11:09
professionalAbhijit Jana23-Jul-09 11:09 
GeneralRe: urgent help needed asp.net C# code error Pin
solo_gaurav23-Jul-09 11:15
solo_gaurav23-Jul-09 11:15 
QuestionJust trying to get simple app to run on the server Pin
Jeffrey Webster23-Jul-09 9:10
Jeffrey Webster23-Jul-09 9:10 
AnswerRe: Just trying to get simple app to run on the server Pin
David Mujica23-Jul-09 9:32
David Mujica23-Jul-09 9:32 
GeneralRe: Just trying to get simple app to run on the server Pin
Jeffrey Webster23-Jul-09 9:48
Jeffrey Webster23-Jul-09 9:48 
GeneralRe: Just trying to get simple app to run on the server Pin
Abhijit Jana23-Jul-09 9:59
professionalAbhijit Jana23-Jul-09 9:59 
GeneralRe: Just trying to get simple app to run on the server Pin
Jeffrey Webster23-Jul-09 10:24
Jeffrey Webster23-Jul-09 10:24 
GeneralRe: Just trying to get simple app to run on the server Pin
Abhijit Jana23-Jul-09 10:28
professionalAbhijit Jana23-Jul-09 10:28 
AnswerRe: Just trying to get simple app to run on the server Pin
Abhijit Jana23-Jul-09 9:37
professionalAbhijit Jana23-Jul-09 9:37 
GeneralRe: Just trying to get simple app to run on the server Pin
Jeffrey Webster23-Jul-09 10:17
Jeffrey Webster23-Jul-09 10:17 
GeneralRe: Just trying to get simple app to run on the server Pin
Abhijit Jana23-Jul-09 10:20
professionalAbhijit Jana23-Jul-09 10:20 
GeneralRe: Just trying to get simple app to run on the server Pin
Jeffrey Webster23-Jul-09 10:26
Jeffrey Webster23-Jul-09 10:26 
GeneralRe: Just trying to get simple app to run on the server Pin
Abhijit Jana23-Jul-09 10:30
professionalAbhijit Jana23-Jul-09 10:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.