|
Hi All,
I have to import a table & a Query from c:\Programfile\asd\MyProject\test.mdb to c:\document&settings\ applicationdata\test.mdb.
I have created & established the Connection string & all. the only thing i am not getting is Query needed to pass...
Please help..
|
|
|
|
|
Well you should post it in the DB forum/section.
Anyway here's one way how you could do it(the query):
OleDbCommnand cmd = new OledbCommand(con);
cmd.CommandText = "CREATE PROC nameOfQueryHere(inName VARCHAR(50))
AS SELECT * FROM tblNameHere
WHERE tblNameHere.Name = inName";
cmd.ExecuteNonQuery();
Of course try catch and all that is up to you. I just posted an ideea.
[EDIT]The same technique for creating a table.
Use a command string in witch you create the table and execute it[/EDIT]
modified on Monday, February 1, 2010 9:07 AM
|
|
|
|
|
|
Hi!
I've read arrow kay can only be intercepted by using KeyUp event. KeyPress only works with characters, and KeyDown allows Control Keys, too, but not arrow keys.
I have tried, and KeyUp works well... but only if i have no other controls in the form! If I have any control enabled and focussed, I can't trap KeyUp Form evnent... I suppose the focussed control traps it.
I have Visual Studio 2003, so I only can use .NET Framework 1 available (or so I have been told). I'm proggramming a simple form that allow me to brouse data fron a database, and I don't have access to this nice BindingNavigator control. So, I have created the form, binded controls, and created the First, Last, Prev, Next buttons to manage my CurrencyManager. It works fine, but I want to be able to browse just using my arrow keys. I think that trap arrow keys ON EVERY active controls in my form is a very poor solution...
Any help, please?
|
|
|
|
|
http://support.microsoft.com/?id=320584[^]
Evidently, you have to override ProcessCmdKey
BTW, google is your friend...
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Thanks!
In fact, just a few minutes ago, I had found this same article (google is your really 'very best' friend), and I was going to post the solution for any people who needed it. This, combined with myButton.PerformClick(), is the complete solution I needed.
Thanks for your very quick reply!
|
|
|
|
|
Hi All
I've crater a cr with sub report. The data in main report is working fine but the subreport is blank.
I do this:
crMyCR cr = new crMyCR();
cr.SetDataSource(dt1);
cr.Subreports[0].SetDataSource(dt2);
Any idea. Please
Thanks
Syed Shahid Hussain
|
|
|
|
|
Syed Shahid Hussain wrote: Any idea
Don't use a CR, and if you must ask questions about it, go and ask the crystal peeps.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
where is crystal peep
Syed Shahid Hussain
|
|
|
|
|
0. Go to google [other search engines are available]
1. Search term 'crystal reports'
2. Find their web-site.
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
sometime... i need to simulate a click in OnMouseMove methode;
In a normal case... when I hold click on a control... and move the cursor out... OnMouseMove it`s still running and mouse positions will be less than zero. (Ex: {X=-10, Y=5} ).
In my case... i need to simulate that "hold click" when i simple move the cursor on my control.... and when mouse leave... OnMouseMove still running and get that value less than zero.
|
|
|
|
|
If you want to simulate a mouse click, the best way is to use the Windows API function PostMessage . You need to use InteropServices to accomplish this.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
hi,
i think this is a job for WIN API functions..
try to look about the: WM_LBUTTONUP and WM_LBUTTONDOWN messages, maby there is a way.
Good luck!
|
|
|
|
|
I did an WinForm Applicaiton with C# code which permit the user to open a file and edit it. I want to add a functionality like VS that detect if the file openend by user is modified outside my application with a dialog : "Do you want to reload it? Yes, No?". There exist such method to do it? I think if I can catch events in my code when VS discovers that the file has been modified outside of the source editor? Thank you for your answers!!!
|
|
|
|
|
Have a look at the FileSystemWatcher
|
|
|
|
|
I have tested the FileSytemWatcher, but when I modified the file in my application, the event is catched also! so I can not distinct that the file is modified inside of my applicaion or outside?
|
|
|
|
|
Turn off the event while saving in your app.
|
|
|
|
|
Good day
I have created two reports one that shows debits (which works 100%), and one that shows debits against credits per day. It shows total debits and total credits per day, ie one line per day. In the SQL database I have a table for debits and another for credits. There are also various rates on each table. Debits and Credits can be bought and sold on a regular basis. In the reports we reflect the weighted averages of the days transactions
SUM(rate * (bought - sold) / SUM(bought - sold)).
In the Debits report, I use the Debits dataset with the individual transactions as they appear in the DB. This approach works 100%. In the DebitsCredits report, I have created a View that combines the values from the two tables. Forcing me to join them per day (ie. getting totals per day, I lose the individual records). This approach gives me different results to the Debits report, wrong results, due to the fact that individual transactions "have beeen lost".
I thought of making use of the two individual tables, but cannot assign both datasets to the same RDLC table ReportItem. I also need to perform calculations between the two datasets (ie. creditamount - debitamount = balance).
Which other way can I bring the individual records of both table into the report and perform calculatins between them?
Many thanx.
Hennie
------------
"It's not the blowing of the wind that determines your destination, it's the set of the sail." - Jim Rohn.
|
|
|
|
|
Hi all, I'm currently using C# and Windows Mobile 6. I've succeeded in exporting data from the datagrid to the selected directories in the mobile. However, when I access the file, an error messaged popped out, "There is no application associated with "file" run the application first, then open this file from within the application." And one more thing, when I send the file to my email address, I can read the contents from the file. Why can't I read the file contents from the mobile? The code below is my code snippet. Please take a look, any help would be appreciated. Thanks in advance. =)
private void btnExport_Click(object sender, EventArgs e)
{
SqlCeDataReader reader;
SqlCeConnection conn = new SqlCeConnection(connStr);
conn.Open();
SqlCeCommand cmd = new SqlCeCommand("SELECT No, DateAndTime, LocationInformation FROM Location", conn);
cmd.ExecuteNonQuery();
reader = cmd.ExecuteReader();
using (StreamWriter writer = new StreamWriter("\\Program Files\\file.csv", true))
{
try
{
while (reader.Read())
{
writer.Write(reader["No"]);
writer.Write("#");
writer.Write(reader["DateAndTime"]);
writer.Write("#");
writer.Write(reader["LocationInformation"]);
writer.WriteLine();
}
}
catch (Exception excp)
{
MessageBox.Show(excp.Message);
}
finally
{
reader.Close();
conn.Close();
}
}
MessageBox.Show("Data of table writtten into \\Program Files\\file.csv file", "Writing completed");
}
modified on Monday, February 1, 2010 4:34 AM
|
|
|
|
|
codenoobie wrote: "There is no application associated with "file" run the application first, then open this file from within the application."
This message seems quite clear; you have tried to open a file but the OS does not know which application to start to process the file. You need to set up an association between your app and the file type. This is done via Windows Explorer on a PC, I don't know the equivalent on a mobile system.
MVP 2010 - are they mad?
|
|
|
|
|
Thanks, I'm quite new to this. So I just have to know about file association right?
|
|
|
|
|
Well, I would suggest you learn about the platform you want your program to operate on, before trying to write any code.
MVP 2010 - are they mad?
|
|
|
|
|
I've found out that the pocket excel actually couldn't read files in csv or xls format, so I just have to save the file into txt format. Thereafter, the file can be read.
|
|
|
|
|
Hello,
I have a function say
<br />
public void GetMeString(out string myStr)<br />
{<br />
myStr = "ABC";<br />
}<br />
This function resides in a C# library and the class for this function is COM visible. Can you please let me know how do I call the function in VB and get the value.
I tried:
Dim var as MyClass
Set var = New MyClass
Dim str As String
var.GetMeString(str)
But str is always empty...
|
|
|
|
|
Q2A wrote: var.GetMeString(str)
I don't know VB but in C# I think that should be var.GetMeString(out str);
MVP 2010 - are they mad?
|
|
|
|