|
ReportDocument rd = new ReportDocument();
rd.Load(ReportPath);
rd.SetParameterValue("@PARAMETER1", "valueAsYouWish");
crystalReportViewer1.ReportSource = rd;
|
|
|
|
|
Please help;
For a couple days I've been battling with writing a report that has to tables linked by a Inner join.
I think I found a work around. I'm using an SQL SERVER database.
Crystal was creating the following query:
SELECT t_EMPINFO.c_EmpFName,
t_EMPINFO.c_EmpCode,
t_Employee_Salary.c_TotalIncome, t_Employee_Salary.c_TotalDeduction,
t_Employee_Salary.c_TotalSalary
FROM t_EMPINFO INNER JOIN
t_Employee_Salary ON t_EMPINFO.c_EmpID = t_Employee_Salary.c_EmpId
WHERE (t_EMPINFO.c_Softdelete = '1') AND (t_Employee_Salary.c_SoftDelete = '1') AND (t_Employee_Salary.c_Year = 'PARAMETER1') AND (t_Employee_Salary.c_Month ='PARAMETER2')
IN Above Query In place of PARAMETER1 and PARAMETER2 I want to pass Differnt value at the run time (e.g 2007 , 01 ) how it's set dynamically
I have questions though:
1) Is it possible to change the sql that crystal generates without writing my own sql command?
Thanks again for all of your help on this!
|
|
|
|
|
ReportDocument rd = new ReportDocument();
rd.Load(pathOfCrystalReport);
rd.SetParameterValue("@PARAMETER1", "Value");
crystalReportViewer1.ReportSource = rd;
|
|
|
|
|
hi everyone,
can somebody tell me how to hide the notify icon from the system tray after quitting the application!! it's still stuck there untill i move the cursor on it only then it disappears, if i didnt, it'll just keep on duplicating each time im running my app!! please help.
thanx
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
I've had similar problems. This is the best I came up with:
1)
create it in your main thread, not in some other thread
2)
Dispose of it in the Dispose method of your main form
protected override void Dispose(bool disposing) {
if(disposing) {
if (components!=null) components.Dispose();
notifyIcon.Dispose();
}
}
3)
If your program crashes, or you abort it using a debugger, the notify icon
remains visible until you hover over it.
Luc Pattyn
|
|
|
|
|
thanx that looks quite handy!! i'll give it a try now.
thank you Luc!
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
just used the dispose methode!! thank you Luc
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
hi
i want to use Store Procedure for Insert,Update and Delete data in sql2005 and VC# 2005,but how to do?
please give an example or article or source for me.
thanks
|
|
|
|
|
When you create your SqlCommands, set the CommandType to CommandType.StoredProcedure. Also add the parameters needed by the stored procedure. E.g. something like this:
using (SqlConnection mySqlConnection = getConnection())
{
SqlCommand insertCommand = new SqlCommand("[dbo].[MY_INSERT_PROCEDURE]");
insertCommand.CommandType = CommandType.StoredProcedure;
insertCommand.Parameters.Add("@StringField", SqlDbType.VarChar);
insertCommand.Parameters["@StringField"].Value = "Nice new string";
insertCommand.Connection = mySqlConnection;
insertCommand.ExecuteNonQuery();
}
|
|
|
|
|
Hello all,
I was wondering if anyone of you could help me with inserting custom hyper links on a RichTextBox control. what i mean is, i want to insert a hyperlink of the form "link_here", and NOT "www.link_here.com", which the rtfbox can detect using DetectURLs...... On clicking on it, i want to open a messagebox.....
i would really be thankful to anyone who could help me....
-- modified at 13:38 Sunday 24th December, 2006
|
|
|
|
|
Have you tried searching the articles on this site? I recall an article on "arbitrary links" in a rich text box control.
|
|
|
|
|
Any one have written C# modbus code
SAS
|
|
|
|
|
A quick Google search of "C# modbus" seems to turn up some good hits.
|
|
|
|
|
The following code shows "Column1" as column caption.
Why ?
How to force DataGrid to display "Caption" as column caption ?
using System.Windows.Forms;
using System.Data;
static class Program {
static void Main() {
Application.Run(new Frm());
} }
class Frm : Form {
public Frm() {
DataTable dt = new DataTable();
DataColumn column = new DataColumn();
column.Caption = "Caption";
dt.Columns.Add(column);
DataGrid dg= new DataGrid();
this.Controls.Add(dg);
dg.SetDataBinding(dt, "");
} }
Andrus
|
|
|
|
|
The DataGrid uses the DataColumn's ColumnName as the column caption. The ColumnName defaults to Column1, Column2, etc., so that's why the code shows "Column1" as the caption. If you set the DataColumn's ColumnName to "Caption", then that will be the caption displayed in the DataGrid.
|
|
|
|
|
The following code causes error in Update() line
Npgsql.NpgsqlException was unhandled by user code
Why exception is not catched ?
catch MUST catch all exceptions!
------ code:
int RowsUpdated;
try {
RowsUpdated = datapter.Update(changes);
}
catch {
System.Windows.Forms.MessageBox.Show("error");
transact.Rollback();
throw;
}
error message details are:
Npgsql.NpgsqlException was unhandled by user code
Message="ERROR: 23505: duplicate key violates unique constraint \"konto_pkey\""
Source="Npgsql"
BaseMessage="duplicate key violates unique constraint \"konto_pkey\""
Code="23505"
Detail=""
ErrorSql="update \"firma1\".\"konto\" set \"kontonr\" = '2', ....
File="nbtinsert.c"
Hint=""
Line="277"
Position=""
Routine="_bt_check_unique"
Severity="ERROR"
Where=""
StackTrace:
at Npgsql.NpgsqlConnector.CheckErrors() in c:\Desenvolvimento\NpgsqlBuildOficial2.0\src\Npgsql\NpgsqlConnector.cs:line 359
at Npgsql.NpgsqlConnector.CheckErrorsAndNotifications() in c:\Desenvolvimento\NpgsqlBuildOficial2.0\src\Npgsql\NpgsqlConnector.cs:line 410
at Npgsql.NpgsqlCommand.ExecuteCommand() in c:\Desenvolvimento\NpgsqlBuildOficial2.0\src\Npgsql\NpgsqlCommand.cs:line 1479
at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior cb) in c:\Desenvolvimento\NpgsqlBuildOficial2.0\src\Npgsql\NpgsqlCommand.cs:line 633
at Npgsql.NpgsqlCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior cb) in c:\Desenvolvimento\NpgsqlBuildOficial2.0\src\Npgsql\NpgsqlCommand.cs:line 601
at System.Data.Common.DbDataAdapter.UpdateRowExecute(RowUpdatedEventArgs rowUpdatedEvent, IDbCommand dataCommand, StatementType cmdIndex)
at System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows, DataTableMapping tableMapping)
Andrus
|
|
|
|
|
The error should be getting caught, but is getting rethrown in the throw; line.
Are you certain it's not getting caught and rethrown? If not, then it's as if your application isn't running that code.
|
|
|
|
|
AndrusM wrote: Why exception is not catched ?
catch MUST catch all exceptions!
Did the message box show up?
After the message box is shown you rethrow (throw in C# without an exception object in side a catch block compiles to the MSIL rethrow operation) which takes the exception and continues to unwind the stack with it.
Also, if you need to rollback a transaction, it would be better to do that before having the process wait on user input because then you start locking other people out of parts of the database until the user responds.
|
|
|
|
|
Hello friends
Happy new year!
There is a project that is needed to match signature of different person,Is there any component for C# that can do it?(If you recomend a free one,It is better!)
Thanks!
|
|
|
|
|
Most signature recognition systems work on how the signature is generated. It captures input from a special stylus and records information such as direction, speed and pressure.
|
|
|
|
|
Greetings!
I want to create project with video abilities.
Here is short description of my needs:
Application needs to be done with .NET Framework.
Application should consist from two parts:
Client application and server application have different functionality, but they both should work with web-cams installed on their sides (client and server sides).
First part is a client application.
Client application can connect to different web – cams and see content of web – cam.
User of client application can talk to server application using microphone and listens answer from server user.
Except this, client application should have ability to save video from server side.
Server application should have similar video abilities with client application.
I analyzed different technologies for my purpose and I lost one's the head in technologies.
Please suggest me what technology best suites for my project.
Thank you all for your attention for my question
Best Regards,
Alex
|
|
|
|
|
Video capturing will likely require use of DirectShow, which is a native C++ framework, now part of Microsoft's native Platform SDK.
However, search the articles on this site, you should find some DirectShow wrappers for use with .NET projects. It might suit your needs.
|
|
|
|
|
Thank you a lot of for your help!!!
|
|
|
|
|
Hi,
I made an even handler for removed rows in the datagridview.
The datagridview gets its data from an xml file. When a row is removed in the datagridview, the row should be removed in the dataset as well.
This is my event handler in constructor:
this.grdTest.RowsRemoved += new DataGridViewRowsRemovedEventHandler(grdTest_RowsRemoved);
This is the code in that event handler:
void grdTest_RowsRemoved(object sender, DataGridViewRowsRemovedEventArgs e)
{
DataSet ds = new DataSet();
ds.ReadXml("Test.xml");
foreach (DataRow dr in ds.Tables[0].Rows)
{
string remove = dr["Row"].ToString();
DataRow[] temprows = ds.Tables[0].Select("Row = " + remove);
if (temprows[0].RowState == DataRowState.Deleted)
{
ds.Tables[0].Rows.Remove(temprows[0]);
}
//if (dr.RowState == DataRowState.Deleted)
//{
// ds.Tables[0].Rows.Remove(dr);
//}
}
ds.Dispose();
}
This is how the xml file looks like:
<?xml version="1.0" encoding="UTF-8" ?>
- <Root>
- <Column>
<Row>test1</Row>
</Column>
- <Column>
<Row>test2</Row>
</Column>
- <Column>
<Row>test3</Row>
</Column>
- <Column>
<Row>test4</Row>
</Column>
</Root>
When i try to start the proram, it gives me this error:
Cannot fine column [test1].
In this line:
DataRow[] temprows = ds.Tables[0].Select("Row = " + remove);
I've tried almost everything to fix this.
I'm running out of ideas...
Can somebody help me with this problem?
Thanks in advance!
|
|
|
|
|
Which line is the error occurring on? (hint: use the debugger to see this info, or look at the stack trace of the error being thrown)
|
|
|
|