Click here to Skip to main content
15,885,546 members
Home / Discussions / C#
   

C#

 
Questionproblem. Pin
amaneet4-Apr-07 0:27
amaneet4-Apr-07 0:27 
AnswerRe: problem. Pin
Christian Graus4-Apr-07 0:38
protectorChristian Graus4-Apr-07 0:38 
GeneralDifference between protected and internal protected Pin
amaneet4-Apr-07 0:45
amaneet4-Apr-07 0:45 
GeneralRe: Difference between protected and internal protected Pin
Sathesh Sakthivel4-Apr-07 1:00
Sathesh Sakthivel4-Apr-07 1:00 
AnswerRe: problem. Pin
Hayder Marzouk4-Apr-07 2:52
Hayder Marzouk4-Apr-07 2:52 
QuestionAdding .dll file to C#.NET 2005 application ? Pin
Software_Specialist4-Apr-07 0:17
Software_Specialist4-Apr-07 0:17 
AnswerRe: Adding .dll file to C#.NET 2005 application ? Pin
Christian Graus4-Apr-07 0:37
protectorChristian Graus4-Apr-07 0:37 
QuestionDataset Pin
yaminilatha4-Apr-07 0:00
yaminilatha4-Apr-07 0:00 
I have to add multiples into a dataset. Using this dataset i am creating a crystalreport. How to add the tables into a dataset. I am getting error in the report.

the code is as follows...



string strConn = "data source=HP10503715219;persist security info=False;initial catalog=MOHAM;pwd=sa;user id=sa";
SqlConnection sqlConn = new SqlConnection(strConn);
DataSet ds = new DataSet();
strCmd = select cm.name, om.oclientref, pm.productname, om.orcvddatetime, od.opastatecode, cu.countyname, om.ordercost, om.additionalcost,om.total,om.subclient from ordermain om, orderdetail od, clientmaster cm, countyusa cu, productmaster pm where cm.clientid = om.oclientid and pm.productid = om.oproductid and cu.countycode = od.opacountycode and om.oslno = od.oslno and (om.ostatus='Completed' or om.ostatus='sent to client');

SqlDataAdapter da = new SqlDataAdapter(strCmd, sqlConn);
da.Fill(ds);
ds.Tables[0].TableName = "ordermain";
ds.Tables[1].TableName = "productmaster";
ds.Tables[2].TableName = "clientmaster";
ds.Tables[3].TableName = "countyusa";
ds.Tables[4].TableName = "orderdetail";


sqlConn.Close();
CrystalReportViewer1.DisplayGroupTree = false;
CrystalReportViewer1.HasCrystalLogo = false;
myReportDocument.Load(Server.MapPath("Total.rpt"));
myReportDocument.SetDataSource(ds);
CrystalReportViewer1.ReportSource = myReportDocument;
CrystalReportViewer1.DataBind();

ERROR: System.IndexOutOfRangeException: Cannot find table1

thanx in advance

yamini
AnswerRe: Dataset Pin
rah_sin4-Apr-07 0:39
professionalrah_sin4-Apr-07 0:39 
GeneralRe: Dataset Pin
yaminilatha4-Apr-07 1:48
yaminilatha4-Apr-07 1:48 
GeneralRe: Dataset Pin
rah_sin4-Apr-07 2:05
professionalrah_sin4-Apr-07 2:05 
QuestionHow do i access MDI parent data from MDI child? Pin
sinosoidal3-Apr-07 23:54
sinosoidal3-Apr-07 23:54 
AnswerRe: How do i access MDI parent data from MDI child? Pin
originSH4-Apr-07 2:16
originSH4-Apr-07 2:16 
GeneralRe: How do i access MDI parent data from MDI child? Pin
sinosoidal4-Apr-07 4:00
sinosoidal4-Apr-07 4:00 
Questionhow can get my friend in yahoo messanger? Pin
B.A3-Apr-07 23:28
B.A3-Apr-07 23:28 
AnswerRe: how can get my friend in yahoo messanger? Pin
Christian Graus3-Apr-07 23:47
protectorChristian Graus3-Apr-07 23:47 
AnswerRe: how can get my friend in yahoo messanger? Pin
Sathesh Sakthivel3-Apr-07 23:49
Sathesh Sakthivel3-Apr-07 23:49 
Questionhow to run another exe by ch#.net Pin
abesinghe3-Apr-07 23:20
abesinghe3-Apr-07 23:20 
AnswerRe: how to run another exe by ch#.net Pin
Martin#3-Apr-07 23:23
Martin#3-Apr-07 23:23 
AnswerRe: how to run another exe by ch#.net Pin
coolestCoder3-Apr-07 23:25
coolestCoder3-Apr-07 23:25 
AnswerRe: how to run another exe by ch#.net Pin
Muammar©3-Apr-07 23:50
Muammar©3-Apr-07 23:50 
GeneralRe: how to run another exe by ch#.net Pin
Christian Graus4-Apr-07 0:03
protectorChristian Graus4-Apr-07 0:03 
GeneralRe: how to run another exe by ch#.net Pin
Muammar©4-Apr-07 0:12
Muammar©4-Apr-07 0:12 
GeneralRe: how to run another exe by ch#.net Pin
Martin#4-Apr-07 0:19
Martin#4-Apr-07 0:19 
QuestionGetting a base control from event arg. Pin
Diego F.3-Apr-07 23:14
Diego F.3-Apr-07 23:14 

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.