|
how can i get the contents of a variable that i declared as SqlDataReader in String format? like writing it to a file or whatever way that's easier. the code looks like below:
SqlConnection cnnConnection = new SqlConnection();
cnnConnection.ConnectionString = "Data Source=.;Initial Catalog=TestDB;User ID=sa;Password=123";
cnnConnection.Open();
SqlCommand myCommand = new SqlCommand();
myCommand.Connection = cnnConnection;
myCommand.CommandType = CommandType.Text;
myCommand.CommandText = "select cname from testtable";
SqlDataReader sdr = myCommand.ExecuteReader();
--- Thanks
|
|
|
|
|
They hide that information in something called documentation[^]
only two letters away from being an asset
|
|
|
|
|
Hi,
I was trying to automate MSExcel using C#. I face a problem when I was trying to open a workbook for the second time, throwing up a message
"xls is already open. Reopening will cause any changes you made to be discarded." inspite of releasing the Workbook Object. Any help to suppress the message would be greatly appreciated.
Thanks in advance.
Code snippet used.
m_oWorkBook = m_oWorkBooks.Open(strFileName, m_objOpt, false, m_objOpt, m_objOpt, m_objOpt, m_objOpt , m_objOpt, m_objOpt, true, m_objOpt, m_objOpt, m_objOpt, m_objOpt, m_objOpt); //open a workbook
.... //Some operation.
GC.Collect();
GC.WaitForPendingFinalizers();
GC.Collect();
GC.WaitForPendingFinalizers();
Marshal.FinalReleaseComObject(m_oWorkBook); // release the workbook
Other Excel COM Objects which are acquired are also released in the proper sequence.
|
|
|
|
|
KarthikonIT wrote: GC.Collect();
GC.WaitForPendingFinalizers();
GC.Collect();
GC.WaitForPendingFinalizers();
Why ??
|
|
|
|
|
GC.Collect();
GC.WaitForPendingFinalizers();
GC.Collect();
GC.WaitForPendingFinalizers();
Is basically used to cleanup Underlying COM Objects for which we don't have reference.
Please visit the below mentioned URL for more details.
http://www.xtremevbtalk.com/showthread.php?t=160433[^]
Thanks.
|
|
|
|
|
How can we detect if a user is idle on a certain webpage for a certain period of time.
The problem i'm facing is the following:
I have a webpage that contains an iframe to another page where in the iframe the page is sent with login parameter. after a certain amount of time the iframe's page timeout without being refreshed so the links in that page are still there but when click one of then you're redirect to a login page. I wish to refresh my main page if the user is idle.
I hope the idea is clear.
Thanks you,
Best Regards.
Mazen
|
|
|
|
|
Wow - C# questions in the ASp.NET forums, and ASP.NET questions in the C# forum.
You can do this with javascript. You can't do it with C#, obviously.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
How can i do this in JavaScript: what's the syntax? the code for it? i've tried a few script but you can just set them to do what i'm asking for, for an interval of time without detecting if the user is idle or not. this means if the user is working on something in the iframe he'll loose his work. if you have the code please send it so i can try it.
Best regards,
Mazen.
|
|
|
|
|
|
lavankumar wrote: we want to break dongle key in hardware device.
what do you mean ? dongles are there for a reason - copyright, security, i/p protection etc if you want to do something illegal please take your request elsewhere - no one here will help you with such - if you had a valid request, maybe the best place to start is the hardware device manufacturer
'g'
|
|
|
|
|
break that device from 3 or 4 floors
|
|
|
|
|
lavankumar wrote: In my project we are using C# .net .in this we are using hardware device .
we want to break dongle key in hardware device.
Here is the code
BreakHWKey _objBreakKey = new BreakHWKey();
if (_objBreakKey.breakKey("Hammer", "screwdriver", "Guess"))
{
Party();
}
else
{
}
Main Class
class BreakHWKey
{
public bool breakKey(string Instrument1, string Instrument2, string Progrmmer)
{
YourDevice.Break();
return true;
}
}
|
|
|
|
|
Hi Everyone,
I am usnig VS05 + c# + Gridview + Web Application.In my application i have a function FillGrid() where data from my userinformation table is filled.
I want to fill the data in gridview such that when user type "s" in textbox at that time automatically data which is having username = "s" is filed in gridview.
In short when user type lettrs at that moment the data related to textbox should filled in gridview.
How can i do this?
Thanks in advance.
|
|
|
|
|
sanpune wrote: I am usnig VS05 + c# + Gridview + Web Application
So you should have post the question in asp.net forum
sanpune wrote: I want to fill the data in gridview such that when user type "s" in textbox at that time automatically data which is having username = "s" is filed in gridview.
Use Ajax .
For your reference[^]
|
|
|
|
|
Hello,
I have a requirement of modifying the datasource of crystal report as per user select option from form. As records per each selection are too much which reduces the performance of application, so I need to do in this way. I tried to change the datasource by setting setdatasource command but it doesn't refresh the data in report.
Thanks in advance
Regards
Ali Raza
|
|
|
|
|
Don't cross post. It's considered rude. Pick a forum and stick to it.
|
|
|
|
|
how can i combine the application with the corresponding db (like building .cab files) when i want to use it as a software package to install it on a client computer in a way that doesn't require sql server to be installed on them? the db is mssql server and it's a windows application.
--- Thanks
modified on Saturday, January 17, 2009 2:38 AM
|
|
|
|
|
You should look into using SQL Server Compact Edition: http://www.microsoft.com/sqlserver/2008/en/us/compact.aspx
|
|
|
|
|
Hi,
Can any one tell me that how can i merge two cells in datagridview??
Plse help me.
Thanks and Regards
Lijo
|
|
|
|
|
i want to set the cursor at the end of the textbox on page refresh.
i am using timer control to refresh my page.
|
|
|
|
|
You have put the same question in asp.net forum .
|
|
|
|
|
hello
is there any way for developing a small story using different srtings,, placed in unorder way.... using maximum likehood calculation..it should align in proper way....
eg: i/p : black, fox,forest,the, into ,ran ,
o/p: black fox ran into the forest
any idea to get that output,,,, from the i/p shown... pls help me
or atleast tell how to implement maximum likehood calculation through c# code
the quieter u become more u hear
|
|
|
|
|
Maximum likelihood in the way your asking would require knowledge and rules about what constitutes likelieness of word ordering in the english language. Even given an advanced, intelligent algorithm, it would be very difficult to create stories from any arbitrary input. As the number of words increases, likeliness is going to decrease along with the possibility of multiple outcomes or no outcome.
I recommend you search Wikipedia for natural language algorithms and probability distribution, and its probably best for this thread to be moved to the algorithms forum.
|
|
|
|
|
Judging from what the maximum likelihood[^] method is, it seems that either are way in over your head, or you don't know what you are asking for...
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Just as Jon pointed out the likelihood decreases as the number of words increase. In other words, as the number of words approach infinity, the likelihood becomes 0. I guess if the number of words are limited even then you would need a clever algorithm to identify all the different parts of speech and place them grammatically. Why are you doing this anyways?
|
|
|
|