|
Yes it is working on a SQL query cause actually im going through the Microsoft sample of datagrid using.Now I want to do some stuff by myself thats why need to add some tables.Thank you
|
|
|
|
|
depends on what you want.
Your DataSet can hold multiple tables.
(eg. query = "Select * from TableOne;Select * from TableTwo"; )
When you execute it and Fill the DataSet you'll have two tables in your dataset.
(then you can even set constraints and relations...)
thus:
yourdataset.Tables[0].Whatever;<br />
yourdataset.Tables[1].Whatever;
you can also create a DAL (data access layer which you can reuse.
eg. create a method which takes a query and returns a dataset.
Then you can do something like this:
DataSet myset1 = DalComponent.DoSelect("Select * from TableOne");<br />
DataSet myset2 = DalComponent.DoSelect("Select * from TableTwo");
(don't forget to create a new DataSet in your DoSelect method.
good luck.
No hurries, no worries.
|
|
|
|
|
Hello,
I added a MouseHover event on my usercontrol... just noticed that it uses the argument EventArgs instead of MouseEventArgs, is there a way to get the coordinates of the mouse pointer that is hovering over the control? Or maybe there's a workaround?
Thanks!
Rafferty
|
|
|
|
|
Hi!
You can always use Cursor.Position to retrieve (or set) the position of the mouse pointer.
Regards,
mav
|
|
|
|
|
Ahh! hehe didn't know there is such a class. Thanks Mav!
Rafferty
|
|
|
|
|
Hi,
My requirement is to export Russian Data stored in Oracle 9i Database to a CSV file.
When the below code is used to export data the Russian Characters are shown as Junk characters when the CSV file is opened in MSExcel. If the same file is opened in Notepad, the Russian Characters are displayed correctly.
Can someone advice, how to export Russian Characters that can also be displayed correctly when viewed in Excel Sheet.
It will be highly appreciated.
With Regards,
/////////////////////////////////////////////////////////////////////////////
/////////////////////// PROGRAM CODE ////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
String strFileName = "";
FileStream fs = null;
BufferedStream buff = null;
StreamWriter writer = null;
bool bExported = false;
try
{
SaveFileDialog saveFileDlg = new SaveFileDialog();
saveFileDlg.Filter = "CSV Format|*.csv";
saveFileDlg.Title = "Save File";
saveFileDlg.RestoreDirectory = true ;
saveFileDlg.ShowDialog();
if(saveFileDlg.FileName != "")
{
strFileName = saveFileDlg.FileName;
saveFileDlg.Dispose();
fs = new FileStream
(strFileName,FileMode.OpenOrCreate,FileAccess.ReadWrite);
buff = new BufferedStream(fs);
writer = new StreamWriter(buff);
writer.Write(strWriteData);
writer.Flush();
bExported = true;
writer.Close();
buff.Close();
fs.Close();
}
return bExported;
}
catch(Exception exp)
{
throw exp;
}
finally
{
writer = null;
buff = null;
fs = null;
}
|
|
|
|
|
CSV files is really a mess, as there is no standard at all to rely on...
You have to find an encoding that the destination program can handle, and use the System.Text.Encoding classes to convert it.
Example:
UTF8Encoding utf8 = new UTF8Encoding();<br />
Byte[] encodedBytes = utf8.GetBytes(unicodeString);
---
b { font-weight: normal; }
|
|
|
|
|
When some action has been added to a context menu in Windows Explorer using a Verb such as "save" (which is not the default action), how to access that Verb from the Main function of the program which is invoked from such Context Menu item in explorer, i.e., how to choose as to which action is to be taken depending upon the command-line arguments?
Is there any sample code for this purpose?
Thanks.
|
|
|
|
|
Just check the arguments that are passed in, and branch accordingly. static void main has a string array passed into it, that's the arguments collection.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks.
But, arguments show only the filename on which the context menu was clicked. What about the "Verb" or the action such as "save"? I mean how to check whether context menu item corresponding to Verb "open" was clicked or Verb "save"? This is relevant when more than one context menu items are placed by one application.
Thanks in anticipation.
|
|
|
|
|
OK, I get it. Try this[^] MSDN page.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
hi all,
The dateTime is showing in a Label like this:
this.label1.Text=DateTime.Now.ToString("dd ,MMMM ,yyyy");
Now suppose that this program open in 24 hours ..Then How can I change date Time of the Label Continuously with out using a Timer?
Can any one send me better url to download DateTime Components with attractive skins?
thanks in advance..
|
|
|
|
|
pubududilena wrote:
Then How can I change date Time of the Label Continuously with out using a Timer?
You can't. to change something, you need an event, and if the event is time, you need a timer.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
as Christian said you need a timer
but why you want to do t without timer?
|
|
|
|
|
hi,
If I use Timer ,Then Application is going to be Little Slow.But If I used another Component like Date Time Picker then it is ok..But I coundn't find atrractive DateTime Component or Library.
regards,
pubudu
|
|
|
|
|
A timer and a date/time picker has completely different uses. What is it that you are try to do, really?
---
b { font-weight: normal; }
|
|
|
|
|
Well any component you use will have a 1 sec timer.. you need to refresh your control on 1 second, don't you?
|
|
|
|
|
You could just change the text of the label continously in a loop. However:
This would cause the text of the label to flicker a lot.
It also uses all the cpu time it can, causing the computer to run at 100% cpu all the time. This will give you a lot of heat, and render the computer virtually useless for anything else.
---
b { font-weight: normal; }
|
|
|
|
|
private System.Threading.Thread timerAvoidanceThread = null;<br />
private void Form1_Load(object sender, System.EventArgs e)<br />
{<br />
timerAvoidanceThread = new System.Threading.Thread(new System.Threading.ThreadStart(TimerReplacement));<br />
timerAvoidanceThread.Start();<br />
}<br />
<br />
private System.Threading.AutoResetEvent wellItsNotATimer = new System.Threading.AutoResetEvent(false);<br />
public void TimerReplacement()<br />
{ <br />
while(true)<br />
{<br />
if(wellItsNotATimer.WaitOne(1000, false))<br />
{<br />
break;<br />
}<br />
<br />
wtfLabel.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
}<br />
}
|
|
|
|
|
Hi,
I have coded the login page of my project.In that i have used the forms authentication.now it is working fine.But the issue is, In the Login screen there is a link for forgot password.If we click that link, it has to open a popup window asking for the username and emailaddress. But now whats happening is if i click the forgot password link it redirects me to login page. Please help me out. Thanks in advance.
thankyou
Anand.
|
|
|
|
|
You have to change your web.config so the forgot password page is excluded from the forms authenication control.
#########################################
<location path="forgetpassword.aspx">
<system.web>
<authorization>
<allow users="*,?"/>
</authorization>
</system.web>
</location>
###########################################
|
|
|
|
|
I am doing a project Mbile Medic.
This project aims to implement a C# based system that helps a doctor tap into his patient database at the hospital via his personal mobile phone and monitor their condition. This helps the doctor monitor his critical patients wherever he may be. The project is implemented by creating the patient database software system for the hospital. The communication module for the software system interfaces a mobile phone (lets call it X) via a serial port or a USB port (depending on the model). The doctor sends an SMS message with the patient ID via his mobile phone to X. The software system collects the message from X and based on the patient ID, queries the database for the patient details, summarizes it, and sends it back to X which then sends the summarized message back to the doctor. The doctor will also be able to send alerts and prescribe medication using this system.
I am using Siemens s35i.
If i send the command to get manufacturer info (AT+CGMI) am getting the response. But if i send the command to receive messages Iam not able to receive messages.. Actually i don know which commands to use. Can u please help me...
Jimi George
|
|
|
|
|
I have a matter with Ms.Access. I don't know how to pass the value from one form to another form. Also, I want to set this value to the text-box of the destination form.
For example:
I'd like to transfer the value '5' inside the code VBA of the form 'form1' to the form 'form2'. After moving successfully, I want to show this value in a text-box of the destination form. Please point me to a way of solutions.
Thanks so much...
|
|
|
|
|
This is the C# forum.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
My question is simple -> can I get full name of assembly in which resides my function that is currently running. To clarify:
<br />
static string ReturnName()<br />
{<br />
return "This function runs in assembly named:"+ Class.Property.ToWhich.U.Need.To.Point.Me<br />
}<br />
Tnx
|
|
|
|