|
I think u must have written some class where u have defined the connection string, change the connection string from there first, what ever new connection string you want. Now in report section u might be using Crystal Report Viewer, so in that Form Load write code like this, according to your table name and class name.
I hope this will help you.
private void CreateReport()
{
this.datcMarketData.getdatafrmdatabase();
JobMarketReport report = new JobMarketReport();
report.SetDataSource(datcMarketData.dSet);
crystalReportViewer1.ReportSource = report;
}
Thanks
Imran
|
|
|
|
|
Hi I am developing an windows application in C#.Net(2003).
My form has some textboxes, button and a datagrid. The functionality of the application is in a DLL.
The functionality is like this.
Enter input parameters in text boxes (one parameter belongs to time)
Click Start Button ==> the control goes to the DLL. based up on the time it has to perform the functionality.(suppose for example if we give 4 hours)
After completing a specific period (for example say 1hour) we have to enter a row in the data grid. THis action is done from the form.
For this i am using a timer in the form, on the elapsed time i am entering a row to the data grid by using a datatable.
Also notice one thing, I am using notify icon to show my application in system tray when it is minimized. If the addition of row is done when the form is in the minimized state, if i double click on the icon in the system tray then it is giving an exception "Object reference is not set" from the code in the notify icon Click. In this i am using a statement
this.ShowInTaskbar = true;
when the form is in normal state, adding a row to grid is happening correctly but the form is not responding after performing this action.
Any one please help me.
Thanks in Advance
Thanks and Regards
Ramu
|
|
|
|
|
Hi -
I try add a new row in DataGridView. But when I try to delete that it says "Uncommitted new row cannot be deleted". Does anyone know how to commit to add a new row? ANy help is appreciated.
Thanks
SHubho
|
|
|
|
|
shubhabratam wrote: I try add a new row in DataGridView. But when I try to delete that it says "Uncommitted new row cannot be deleted". Does anyone know how to commit to add a new row? ANy help is appreciated.
I think you may need to call Update() method or EndEdit() method of DataGridView..
For example ~
myDataGridView.EndEdit();
OR
myDataGridView.Update();
Hope it helps.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
I think u need to update the table. try this code, it is with respect to text boxes, accordingly you can try with datagrid.
string update = "Update JobEvaluationPlanData set Plan_id='" +
TxtPlanId.Text + "' ,Com_Fact='"
+ this.TxtCompFact.Text + "' ,Com_Fact_Def='"
+ this.TxtCompFactDef.Text + "' ,CF='"
+ this.TxtFactor.Text + "' where Plan_id= '" + this.TxtPlanId.Text + "'";
if (
this.TxtPlanId.Text != "" &&
this.TxtCompFact.Text != "" &&
this.TxtCompFactDef.Text != "" &&
this.TxtFactor.Text != "")
{
OleDbCommand command = new OleDbCommand(update, datcJobEvaluationPlanData.con);
datcJobEvaluationPlanData.dAdapter4.UpdateCommand = command;
//do the update
datcJobEvaluationPlanData.dAdapter4.UpdateCommand.ExecuteNonQuery();
MessageBox.Show("Record Updated...");
RefreshData();
}
Thanks
Imran
|
|
|
|
|
I am using a DataGridView Control. I want to add a row which is just added to the Grid.
|
|
|
|
|
I have used this code to add data to the table with respect to Text Boxes, u can try this for Datagrid with some changes.
string strInsert;
strInsert = "insert into JobEvaluationPlanData" +
"(Plan_Id, Com_Fact, Com_Fact_Def, CF)"
+ "values('" + this.TxtPlanId.Text + "','"
+ this.TxtCompFact.Text + "','" + this.TxtCompFactDef.Text + "','"
+ this.TxtFactor.Text + "')";
if (
this.TxtPlanId.Text != "" &&
this.TxtCompFact.Text != "" &&
this.TxtCompFactDef.Text != "" &&
this.TxtFactor.Text != "")
{
OleDbCommand command = new OleDbCommand(strInsert, datcJobEvaluationPlanData.con);
datcJobEvaluationPlanData.dAdapter4.InsertCommand = command;
//Do the Insert
datcJobEvaluationPlanData.dAdapter4.InsertCommand.ExecuteNonQuery();
MessageBox.Show("New Record Added...");
RefreshData();
TxtPlanId.ReadOnly = true;
}
Thanks
Imran
|
|
|
|
|
Hello ,
I am having a problem in this issue,
I am trying to print a XPS document by passin job name and file path to
PrintQueue.AddJob(jobname,filename,false)
now job is getting queued and printed but the folder where the file is which i am printing is getting locked(i.e I am not able to delete the folder) even if i am deleting the file inside it.
Who am I?
Do you know me....
|
|
|
|
|
Hello,
There are one Editable Gridview in my winform. This GridView is binded with DataTable. After making some changes in GridView, I want to update the DataTable that is binded to GridView.
I have tried with Grid.Update() and DataTable.AcceptChanges();. but it doesn't work.
So, How to synchronize between GridView and DataTable? OR how can I update the DataTable from DataGrid?
Thanks in advance.
|
|
|
|
|
Hi All,
For example im having a string like this "0:30:1A:1E:55:2"
i want to convert this string to "00:30:1A:1E:55:02"
how can i do this.
right now im split the string using ':' and then find the length if its 1 then add 0 in front of it, it works fine for me....
but i think some simpler way must be there....
so plz guide me if am wrong
With Regards
Amjath
|
|
|
|
|
Amjath Rahman wrote: add 0 in front of it
String.PadLeft Method[^]
<br />
Dim str As String<br />
Dim pad As Char<br />
str = "forty-two"<br />
pad = "."c<br />
Console.WriteLine(str.PadLeft(15, pad)) ' Displays "......forty-two".<br />
Console.WriteLine(str.PadLeft(2, pad)) ' Displays "forty-two".
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Hello,
VS 2005
i have created a small windows application. I am wondering how can i make this into a independent program that can run as a custom action in a setup program.
Is it enough go into the bin directory and use the exe that is in there, and add that to the setup as the custom action.
The windows application uses a picture, is it best to have the picture embedded?
Many thanks for any suggestions.
Steve
|
|
|
|
|
Why did your post get downvoted?
Here[^] is an article that contains a good example of how to use your own code for a custom action.
|
|
|
|
|
Hi.
A few quick questions:
Does C# have any function that will compute crc32?
How can I port C code into C#? Do I have to rewrite it, or is there a quicker way?
|
|
|
|
|
dfn wrote: Does C# have any function that will compute crc32?
No
dfn wrote: Do I have to rewrite it
Yes, that is the easiest way.
There are conversion tools that probably need some postprocessing, for a simple
code snippet it is not worth the trouble.
BTW there are some CRC articles on the CodeProject site...
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
dfn wrote: Does C# have any function that will compute crc32?
No, but see this[^] article.
/ravi
|
|
|
|
|
Hi Guys:
I have written an client server application in C sharp.My application is connected through GPRS USB modem.
My problem is currently all the messages store in the sim card (by default) and the sim card memory gets full after every 25 messages recieve
how can I programatically store the messages into computer memory and delete it from the modem .
thanks
|
|
|
|
|
Hello to all,
I am using a socket server in c# I have created based on one from the code project.
it's an asynchronous server, creating a worker thread for client.
till now only tested with one client connected.
my problem is, when I disconnect a client and the reconnect, I get an exception of type
"An existing connection was forcibly closed by the remote host"
I need my application to operate in a manner that when the client reconnects, it's still
communicating with the server on same "IPEndPoint" and keep receiving messages from it,
as if no disconnection occurred.
P.S
When reconnecting the object still holds the same handle and port but ip is changed to
0.0.0.0
when in debug I am breaking on the spot where i get the exception.
The program stands there and values are LocalEndPoint = {192.168.2.100:5001}
on that breakpoint I dis and reconnect the device, and on the same break I get these
new values LocalEndPoint = {0.0.0.0:5001};
Please help me!!!!!!!!!!!
-- modified at 14:04 Sunday 12th August, 2007
|
|
|
|
|
As .txt opens with notepad as default, with what program .exe opens with?
I am aware, .exe is native to operating system. However i have a packaged program which is embedded into main program and is extracted to temp folder before execution..however with .tmp extention assigned. I can rename .tmp with .exe, I am just digging into windows internals and curious how this works.
I guess somefunction of rundll.dll is capable of executing .tmp files, but i am not quite informed about it.
Also, noticed that installshield and other installers copies executables as .tmp files and later executes them
thanks well in advance.
h.
|
|
|
|
|
The EXE files are not opened by some other program, they run as is, that's why
they are called executables ! And they each can have quite different functionality.
This is different from other files (often called documents):
TXT/DOC/XLS/PPT... files always open with the same program (typ. Notepad, Word,
Excel, PowerPoint...)
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
|
I have this string :
string number = "%123293395976?;107101637=461?";
and I want to take only this part 293395 and put it in another string.
How can I do it? if you could provide me a code for that problem.
I knew that it could be done by using StringTokenizer or taken it character by character, but I don't know how to do it?
Thank you a lot for your help.
-- modified at 11:30 Sunday 12th August, 2007
|
|
|
|
|
you seem to want to take a few digits out of a sequence of digits;
that certainly is not what a tokenizer would do naturally.
What makes you decide where the start and end of the substring are ?
fixed positions ? depending on earlier characters ?
have a look at String.Substring
if you need more help, try to be clear about what the context is, what those
numbers/digits represent, etc.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Thank you a lot for your reply ...
|
|
|
|
|
CanadianBoy wrote:
These digits are taken from card reader and the digits I want to take from the card reader digits is product name. By this digits I want to take I can check if the product name is inside the database or not.
I tried String.Substring, but it is not provided in my C#.
if you have or implemented any code that can these digits, I would be thankfull.
That is impossible. Look again.
What happens when you try to use it ? Compiler error ? run-time error ?
If so, show the code and the details of the response.
And if you don't know how to use Substring, look it up on MSDN, on Google,
or in all the articles here on CodeProject.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|