Click here to Skip to main content
15,921,793 members
Home / Discussions / C#
   

C#

 
QuestionHow can i find the current users 'My Documents' (XP) Pin
Anthony Mushrow12-Jul-06 13:45
professionalAnthony Mushrow12-Jul-06 13:45 
AnswerRe: How can i find the current users 'My Documents' (XP) Pin
Sean8912-Jul-06 14:00
Sean8912-Jul-06 14:00 
GeneralRe: How can i find the current users 'My Documents' (XP) Pin
Anthony Mushrow12-Jul-06 14:09
professionalAnthony Mushrow12-Jul-06 14:09 
QuestionOpening a file that has already be lock by another user for write access Pin
keroed_edmond12-Jul-06 13:35
keroed_edmond12-Jul-06 13:35 
AnswerRe: Opening a file that has already be lock by another user for write access Pin
Not Active12-Jul-06 14:03
mentorNot Active12-Jul-06 14:03 
GeneralRe: Opening a file that has already be lock by another user for write access Pin
keroed_edmond12-Jul-06 14:19
keroed_edmond12-Jul-06 14:19 
GeneralRe: Opening a file that has already be lock by another user for write access Pin
keroed_edmond12-Jul-06 16:43
keroed_edmond12-Jul-06 16:43 
QuestionPls Help Me !!! Pin
Fahad Ali12-Jul-06 11:51
Fahad Ali12-Jul-06 11:51 
i am using this code to print a report but the problem comes when i pass parameters like Supplier_Id as i have done in this query the error comes like "Query engine Error and follows with the path.I am using this code.Well the problem doesn't comes with the query in which i have not passed parameters Pls help me to sort out this problem.Thanks Fahad.

try
{
int Supplier_Id=Convert.ToInt32(Supplier_Id_C.Text);
string s_p="sp_P_S_Rpt";
SqlConnection conn = Class_Connection.Make_Conn();
// SqlCommand command = new SqlCommand(s_p, conn);
// command.CommandType = CommandType.StoredProcedure;
// command.Parameters.Add("@Supplier_Id", SqlDbType.Int);
// command.Parameters["@Supplier_Id"].Value = Supplier_Id;
// SqlDataAdapter adapter = new SqlDataAdapter(command);
// DataSet ds = new DataSet();
// adapter.Fill(ds, "P_S");
//


// dataGrid1.DataSource=ds;
// dataGrid1.DataMember="P_S";
// P_R_Rpt obj = new P_R_Rpt();
// obj.SetDatabaseLogon("sa","sa","CDMA","Final_Project1_e");
// obj.SetDataSource(ds);
// crystalReportViewer1.ReportSource=obj;
// Cursor = System.Windows.Forms.Cursors.Default;
//reportDocument1.SetDatabaseLogon("sa","sa","CDMA","Final_Project1_e");


// reportDocument1.SetDataSource(ds);
// crystalReportViewer1.ReportSource = reportDocument1;

// Finalized.P_R_Rpt obj = new P_R_Rpt();
// obj.SetDatabaseLogon("sa","sa","CDMA","Final_Project1_e");
// reportDocument1.SetDataSource(ds);
// crystalReportViewer1.ReportSource = reportDocument1;

SqlCommand command = new SqlCommand(s_p, conn);
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add("@Supplier_Id", SqlDbType.Int);
command.Parameters["@Supplier_Id"].Value = Supplier_Id;
SqlDataAdapter adapter = new SqlDataAdapter("SELECT dbo.Supplier.Supplier_Name, dbo.P_Order.P_O_Date, dbo.P_Order.P_O_Serial_No, dbo.P_Order.P_O_Id FROM dbo.P_Order INNER JOIN dbo.P_O_Details ON dbo.P_Order.P_O_Id = dbo.P_O_Details.P_O_Id INNER JOIN dbo.Supplier ON dbo.P_O_Details.Supplier_Id = dbo.Supplier.Supplier_Id WHERE(dbo.P_O_Details.Supplier_Id = 2)","Data Source=CDMA;Database=Final_Project1_e;UID=sa;PASSWORD=sa");// = new SqlDataAdapter(command);
//P_R ds = new P_R();
//SqlDataAdapter adapter = new SqlDataAdapter(command);
DataSet ds = new DataSet();
adapter.Fill(ds,"P_R_Rpt1");

dataGrid1.DataSource=ds;
dataGrid1.DataMember = "P_R_Rpt1";
//P_R ds = new P_R();
// P_R_Rpt obj = new P_R_Rpt();
// obj.Load();
// obj.SetDataSource(ds);
P_R_Rpt1 obj = new P_R_Rpt1();
obj.SetDataSource(ds);
//obj.Load();

//sample_Rpt1.FilePath = @"C:\\Documents and Settings\\Fahad\\Desktop\\Finalized_With_Report\\Sample_Rpt.rpt";
obj.SetDatabaseLogon("sa","sa");//oRpt.SetDataSource (ds);

crystalReportViewer1.Visible=true;//CrystalReportViewer1.Visible=true;
crystalReportViewer1.DisplayGroupTree=false;
crystalReportViewer1.ReportSource = obj;//CrystalReportViewer1.ReportSource = oRpt;
//obj.Load();
//obj.Refresh();
// crystalReportViewer1.RefreshReport();//.RefreshReport()
// crystalReportViewer1.Refresh();//crystalReportViewer1.Refresh()
// crystalReportViewer1.Show();//crystalReportViewer1.Show()


}
catch(Exception ee)
{
MessageBox.Show(ee.Message);
}
AnswerRe: Pls Help Me !!! Pin
PlayByTheRules12-Jul-06 22:05
PlayByTheRules12-Jul-06 22:05 
QuestionHow can create Software lock in C# ? Pin
persian_king12-Jul-06 11:39
persian_king12-Jul-06 11:39 
AnswerRe: How can create Software lock in C# ? Pin
Not Active12-Jul-06 14:00
mentorNot Active12-Jul-06 14:00 
AnswerRe: How can create Software lock in C# ? Pin
Divyang Mithaiwala12-Jul-06 20:23
Divyang Mithaiwala12-Jul-06 20:23 
QuestionPropertyGrid meets Generics Pin
Mattman20612-Jul-06 11:16
Mattman20612-Jul-06 11:16 
AnswerRe: PropertyGrid meets Generics [modified] Pin
Mattman20612-Jul-06 16:25
Mattman20612-Jul-06 16:25 
QuestionProblem with code returning parameter from stored procedure Pin
leckey12-Jul-06 10:26
leckey12-Jul-06 10:26 
AnswerRe: Problem with code returning parameter from stored procedure Pin
Christian Graus12-Jul-06 10:35
protectorChristian Graus12-Jul-06 10:35 
GeneralRe: Problem with code returning parameter from stored procedure Pin
led mike12-Jul-06 10:43
led mike12-Jul-06 10:43 
GeneralRe: Problem with code returning parameter from stored procedure Pin
leckey12-Jul-06 10:45
leckey12-Jul-06 10:45 
GeneralRe: Problem with code returning parameter from stored procedure Pin
leckey12-Jul-06 10:44
leckey12-Jul-06 10:44 
GeneralRe: Problem with code returning parameter from stored procedure Pin
Christian Graus12-Jul-06 10:48
protectorChristian Graus12-Jul-06 10:48 
GeneralRe: Problem with code returning parameter from stored procedure Pin
leckey12-Jul-06 10:50
leckey12-Jul-06 10:50 
GeneralRe: Problem with code returning parameter from stored procedure Pin
Christian Graus12-Jul-06 10:58
protectorChristian Graus12-Jul-06 10:58 
GeneralRe: Problem with code returning parameter from stored procedure Pin
leckey12-Jul-06 11:02
leckey12-Jul-06 11:02 
GeneralRe: Problem with code returning parameter from stored procedure Pin
Christian Graus12-Jul-06 11:09
protectorChristian Graus12-Jul-06 11:09 
GeneralRe: Problem with code returning parameter from stored procedure Pin
leckey12-Jul-06 11:15
leckey12-Jul-06 11:15 

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.