|
i am using datetimepicker component for selecting dates.
and i will store that in string variable
(Eg: string date1 = renewalDTP.Value.Day + "/" + renewalDTP.Value.Month + "/" + renewalDTP.Value.Year;)
if i want to compare two dates how can done it....
|
|
|
|
|
Read up on the DateTime class and discover at least one method that yields a date difference, expressed as a TimeSpan.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
I am having a problem with Tableadaperts. I am trying to insert a new record into the database using the Tableadapert.insert.
I have commented out // [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
and put a break point to see how the method runs every thing looks fine no exceptions. I get a return value of the record but the database table remains empty.
What am I doing wrong? The tableadaper is supposed to directly interact with the database?
private void button1_Click(object sender, EventArgs e)
{
try {
int val = 0;
tbUsersTableAdapter ta = new tbUsersTableAdapter();
val = ta.Insert("other1", "other");
//val retuns 1
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
|
|
|
|
|
I don't use the tableadapter but it seems to me you need to give it various bits of information, like the connection, insert statement, update statement etc. You seem to have created an adapter, thrown some data at it and expected it to magic the data into the database.
I suggest you do some reading/research before you cry for help, this issue has been answered MANY times and there are examples and tutorials out there.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi, all expert
I'm from Thailand.I interesting to know whether have any method to import pdf. file into whatever DBMS ?
Can import by coding or not ? Or only with third party control supplier? And what the control name to accomplished ?
Hope any expert give me clearify my doubt.
Regard,
Nont....
|
|
|
|
|
Hi All,
I wrote a Windows application using VS 2005 (c#). I made an installer by making a Setup and Deployment project and writing a corresponding installer class. There are a couple files I need to include with the program, which will be altered by the (installed) program during use. The issue I'm facing is that when I install the program (and files) and run the program...the files are changed, as I expect. I uninstall the program and reinstall the program and the files are not fresh...they contain the changed contents!
How I am including the files is by right clicking on MySetupProject -> view -> file system. I right clicked on Application Folder -> Add -> File.. Then I added each file to the Application folder. The files are added to the correct folders during installation and are removed during uninstallation.
I'm not sure what is happening. If anyone has an idea of what is going on or if I'm doing something wrong please let me know.
Thank you.
-choo_chu
|
|
|
|
|
Scenario : client server application. vb6 client side application to Microsoft SQL server database.
all clients have registry keys to provide odbc connection to a database holding available environments.
Once a user has selected the environment they require the specific odbc string is supplied from this master to the specific db for the selected environment and the master plays no further part.
Problem : because every user selects from the same list all connections are listed under the same user in SQL making life very difficult to resolve locking issues that occure.
The use of windows integrated logins is not possible as i have no access to the application code and we need to prevent r/w access to the environment databases from say office applications.
Solution : I am therefore considering implementing a wrapper for the client application to generate individual sql logins and account in the master DB so that the connections can then be distinguished in SQL.
The wrapper will need to talk to a service that will have the relevant sql access to create / disable / enable the logins.
Question : with all this said can I please have relevant pointers / ideas / examples to first create this service that will need to talk to SQL via a dedicated admin account and also to clients on the network probably via IP using again probably XML.
I am not looking for spoon feeding as I enjoy learning in this hands on method just places to go / articles and examples that explain principles that I can then adapt.
Thanks for the assistance
Bryden
P.S I do realise that this will not be a walk in the park and that I could probably have posted this on a number of different forums but I plan on using c# unless advised differently.
|
|
|
|
|
Your core issue is managing the locking issues, probably identifying the culprit PC so you can go thump the user. I know when we use OLEDB the workstation id is in the connection and can be seen in Profiler, I don't know if ODBC supplies this info. We then have an internal register of PC/User so we can find the transgressor, what I really want is a remote reboot
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Yes ODBC does provide the workstation ID.
Life becomes more complex however when the client is a terminal / citrix server then all users also have the same client.
I have another way around this by interogating sys.sysprocesses and lokking up not only the hostname but also the hostprocess columns.
The hostprocess number equates directly to the process id that can be seen in task manager or terminal server manager to identify the user.
The main point of this is that I think my solution would make life easier for my customers and allow me to learn a lot more about c#.
I do know where your coming from though with the remote reboot although a sledge hammer is sometimes more appropriate!
|
|
|
|
|
Bryden.Murdoch wrote: allow me to learn a lot more about c#.
I seem to have got the goals mixed up , this one I can relate to.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
|
I was coming to this forum hoping to help people but then I read this and my brain just kindof BSODed trying to interpret the code as C#
It's not really a problem, but maybe you should try the ASP forum?
|
|
|
|
|
hey guys,
i have a dataset which is bound to a gridview , i would like to make the first row in the dataset as the last row in the dataset or in the gridview ( eventually i need it for the gridview) what is the most effective way to do such simple task?
Net
|
|
|
|
|
i want to use web space for some files. and i want to build a software that can be install on computer,and by that software i can search some files in that particular web sapce and also downlaod that files and also can upload some files......... is it possible with C#???????
|
|
|
|
|
Yes
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
That's called FTP. You wan't to make an FTP client.
|
|
|
|
|
pls tell me how i use?
i also wanna some database which database should i use? and how? pls guide me
Thanx.
|
|
|
|
|
Why would you want to use a database? Ftp would be comparable to traversing a tree structure using recursion, you wouldn't need a database..
|
|
|
|
|
My need is to make "video collection system" for my final year project. I already make it for LAN,but now i want to make it web base application so that any one can install application implemented in C# and download videos from web from anywhere and also can upload video. It is something like Metacafe.
Pls tell me how i can build this. Provide me some guide line.
Thank you for kind support
|
|
|
|
|
Hello,
I am working on a project in vs2008 (C#). The problem facing is when i open a mdi parent form in maximize style and then open any other form on that form i always open as maximize
Thank You!
|
|
|
|
|
The WindowState of the MdiParent makes no difference. If one ChildForm is Maximized then so are all ChildForms however.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Hi,
I'm using C#.net 3.0. I have use the frameGrabber class to grab the frames from the video file and to convert the frames into bitmap format.The code is giving error in the "foreach (FrameGrabber.Frame f in fg)line of the code" highlighting "in" giving error---"InvalidCastException was unhandled by user"(Unable to cast COM object of type'DirectShowLib.DES.MediaDet' to interface type 'DirectShowLib.DES.IMediaDet'.This operation failed because the QueryInterface call on the COM component for the interface with IID '{65BD0710-24D2-4FF7-9324-ED2E5D3ABAFA}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).).I use this background worker so that I can stop the extraction of frame in middle of execution,but if i don't use this Background worker the code is running properly.
[code]
private void button43_Click(object sender, EventArgs e)
{
backgroundWorker1.RunWorkerAsync();
}
private void button44_Click(object sender, EventArgs e)
{
backgroundWorker1.CancelAsync();
}
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
{
string outPath = txtExtBitmap.Text;
System.IO.Directory.CreateDirectory(outPath);
if (fg != null)
{
foreach (FrameGrabber.Frame f in fg)
{
using (f)
{
picBoxFrame.Image = (Bitmap)f.Image.Clone();
f.Image.Save(System.IO.Path.Combine(outPath, "frame" + f.FrameIndex + ".bmp"), System.Drawing.Imaging.ImageFormat.Bmp);
}
if (fg == null)
{
return;
}
}
}
if (backgroundWorker1.CancellationPending)
{
e.Cancel = true;
return;
}
}
private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
if (e.Cancelled)
{
MessageBox.Show("Operation Cancelled");
}
else
{
MessageBox.Show("OperationCompleted");
}
}
[\code]
|
|
|
|
|
Not sure about the specific error, but the CancellationPending check should be inside the foreach loop otherwise it won't be reached until all the frames have been 'grabbed'and the method is about to return anyway, which makes it kind of pointless.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
|
Yeah, I've had a look and I'm not sure about that, but a least when you fix it you'll be able to cancel when you wish.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|