|
hi all
i want to insert the value in field of type "time stamp" in sql server 2000 from C# application. that field is not null.
when i had tried to insert new record in a row of table leaving time stamp field empty but it insert value as . how to get time stamp and insert into sql server.
Tasleem Arif
|
|
|
|
|
Please read "How to get an answer to your question" which is the first Message in the list.
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum
led mike
|
|
|
|
|
I have two listboxes on a webform. One has a list of groups in it, and the other will have the members of the group depending on what index is selected in the group listbox. I am handeling the SelectedIndexChanged event of the Group list box so that I can change the contents of the second listbox. The problem is that the event doesn't seem to be firing:
protected void GroupList_SelectedIndexChanged1(object sender, EventArgs e)
{
int index = GroupList.SelectedIndex;
DataRow[] rows = dSet.Tables["Mounts"].Select("Group_Number =" + GroupList.Items[index].Text);
foreach (ListItem item in MountList.Items)
{
MountList.Items.Remove(item);
}
foreach (DataRow row in rows)
{
MountList.Items.Add(row[0].ToString());
}
}
Any Ideas?
Thanks for any responses
|
|
|
|
|
Why aren't you using DataBinding?
Sean89 wrote: The problem is that the event doesn't seem to be firing:
"Seem to be" does not help. It either does or does not, which is it?
If it is not firing then something is not set correctly.
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum
led mike
|
|
|
|
|
led mike wrote: If it is not firing then something is not set correctly.
I thought about that for a second then I realized that I didn't have AutoPostBack set to true for the control.
Works fine now Thanks for the heads up!
|
|
|
|
|
I have been working on an application that utilizes the DragDrop Event Handler. To accomplish this, I created a "public" variable named dragPoint which has both X and Y coordinates and made the assignment to that point in the MouseDown() Event handler.
The cursor remembers that clicked point on the control from the MouseDown() Event Handler when the user clicks on the control. However, the DragOver() Event handler does not reconcile that point click from the MouseDown() Event handler properly. Could somebody please provide some insights as I am missing some concept here.
The code is as follows:
private static void _ctrl_DragOver(object sender, DragEventArgs e)
{
try
{
if(DragDropHandler.CanDropHere((Control)sender, e.Data))
{
Control cthis = (Control)sender;
e.Effect = DragDropEffects.Move;
Control ctrl = DragDropHandler.GetControl(e.Data, false, true);
// Here is the code with the problem
Point NewLocation = cthis.PointToClient(new Point(e.X, e.Y));
ctrl.Left = NewLocationX + 2;
ctrl.Top = NewLocation.Y + 2;
// End problem code above
}
else
{
// Error Message
}
}
}
Note: I tried subtracting away the dragPoint.X from the "new Point()"
in the cthis.PointToClient() but that only causes the cursor to change to a circle with a slash through it indicating a mathematical conceptual error somewhere. I also tried to add the dragPoint.X to the ctrl.Left and the ctrl.Top, and while that does work, it causes the cursor to be placed to the left and to the top at a point equal to the point that the control is clicked in the MouseDown() Event. When I tried to subtract the dragPoint.X and dragPoint.Y from the ctrl.Left and ctrl.Top statements, then the cursor changes again to a circle with a slash through it.
What concept have I missed here? Should I be using PointToClient() or PointToScreen() ot something else to get the cursor to drag from the point that the user clicks on the control?
// Alternate code tried
Point NewLocation = cthis.PointToClient(new Point(e.X - dragPoint.X, e.Y - dragPoint.Y));
ctrl.Left = NewLocationX - dragPoint.X;
ctrl.Top = NewLocation.Y - dragPoint.Y;
// End alternate code tried
-- modified at 18:31 Saturday 6th May, 2006
|
|
|
|
|
Try using an offset with respect to the initial position. Modify your alternate code as follows:
<br />
ctrl.Left = ctrl.Left + e.X - dragPoint.X;<br />
ctrl.Top = ctrl.Top + e.Y - dragPoint.Y;<br />
|
|
|
|
|
Is there a program out there that can read tags for .m4a files (itunes formats) and that has source code for c#? I already found one for reading id3 tags on .mp3 files here: http://www.codeproject.com/csharp/ShellID3TagReader.asp, but I have yet to find one that will work on .m4a files.
Thanks!
|
|
|
|
|
|
Should be in the .NET framework install dir. I have 2 versions (in for 1.1 and one for 2.0).
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
i've serched into all my pc but no found.
Where can i downalod it? and where can i found a tutorial to use?
|
|
|
|
|
Susuko wrote: Where can i downalod it?
You could try reinstalling the .NEt framework or VS200x.
Susuko wrote: where can i found a tutorial to use?
Here are a few:/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
Hello
I want convert a file into a stream.
I do it like this:
FileInfo fl = new FileInfo(@"C:\test.wav");
Stream sm = fl.Open(FileMode.Open);
But I do not think this is the best way to do it!
Can someone tell me if this is a good way, or maybe tell me a better way of how to do this?
Thanks
QzRz
|
|
|
|
|
This is a good way, but the FileInfo object is not necessary (unless you are using it somewhere else).
Try this:
Stream sm = new FileStream(@"C:\test.wav", FileMode.Open);
Hope this helps,
DigitalKing
|
|
|
|
|
Thanks for the fast reply
I do not need the FileInfo, so the answer you gave me is very good.
Thanks
|
|
|
|
|
What DigitalKing said, but you could also use the using statement to close the stream and release resources correctly. Something like
using (Stream s = ...)
{
}
Regards
Senthil
_____________________________
My Blog | My Articles | My Flickr | WinMacro
|
|
|
|
|
i m making a programe which show the logical drives using string how can represent it in tree view form
majid shahid
|
|
|
|
|
You are looking for the TreeNode[^] class. You can access the nodes in the tree using treeView.Nodes , so to add nodes, just do treeView.Nodes.Add(yourtext) . To add subnodes, get a reference to the TreeNode object using treeView.Nodes[i] and then call Add on its node collection.
Does this answer your question?
Regards
Senthil
_____________________________
My Blog | My Articles | My Flickr | WinMacro
|
|
|
|
|
how can i represent the string in treeview form.
majid shahid
|
|
|
|
|
What the heck are you talking about?
|
|
|
|
|
Hi,
I have a problem with checkbox. Actually i have a form on which there are two grids, two radio buttons and a check box. Basically when i databind the check box and/or radio buttons, the other controls dont work properly. Specially when adding new rows to grids(Which are added by clicking NEW button on the tool bar) the CURRENT row does not get to the new row. And also the only textbox does not become blank when we click NEW. I know there is some problem with Checkbox databinding but i really dont know what that problem is and how to remove that problem. Please tell me if any one know about that...
Regards,
Wasif Ehsan,
Software Engineer.
-- modified at 9:25 Saturday 6th May, 2006
|
|
|
|
|
VS 2005 C# Express, .NET 2.0
The following code causes the Body member of the Webbrowser control to be set to null. Why?
mshtml.IHTMLDocument2 doc2 = (mshtml.IHTMLDocument2) this.webBrowser1.Document.DomDocument;
doc2.designMode = "On";
I am trying to programmatically select an element (<OPTION>) in a web page listbox (<SELECT>) the way a user would with the left mouse button. So, far I've found nothing that will do this.
|
|
|
|
|
cweeks78681 wrote: I am trying to programmatically select an element (OPTION) in a web page listbox (SELECT) the way a user would with the left mouse button.
What does that have to do with setting designMode to ON?
Would you know how to do that in a javascript running in the HTML page? If not you should learn how to do that first because it is the same thing. The DOM in WebBrowser is the same DHTML DOM you use in javascript.
You want to get a reference to the DHTML listbox element and set it's .selectedIndex property to the desired index.
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum
led mike
|
|
|
|
|
> What does that have to do with setting designMode to ON?
It was a shot in the dark. I thought maybe the HTMLDocument was in some kind of read-only state because I have NEVER found a way to modify a page in the web browser. Some kind of exception is always thrown. One said something about an access violation.
|
|
|
|
|
That's what I call it, anyway...
I want to write a class that would know how to act on two different cases:
- A single object of it was created.
- An array of objects of it was created.
The purpose of this is to fire a different event for each of the cases.
Lets take WinSck for example...
If you create a single object, you get the regular arguments.
But create an array, and it automatically generates the same event with an additional index argument.
1. How can I detect from within my class if it's used as an array?
2. How can I, after detection, pass the index of the object, without holding an index/id field inside the class?
Thanks in advance,
Shy.
|
|
|
|