|
Hello,
i have a question to this article: http://www.codeproject.com/KB/audio-video/SoundViewer.aspx
I want to get the frequency of a sequence, maybe the last 300 milliseconds, because i want to know, for example which "musical note" the lase sequence was, maybe, you can imagine it like the singstar software (sry for the advertising), i only want to know how "high" the person is speaking in the mic.
And how can i get the volume with that somebody speaks in the mic? I need that in integers or other numeric values.
I hope somebody can help me... many thanks
|
|
|
|
|
Is it possible to use SqlBulkCopy when a uniqueIdentifier column is the first column in the destination table? IF so how can I accomplish this.
Also Is there a way to use this line of code some how with a datareader when each datareader record is added to the destination table?
recnum = System.Guid.NewGuid();
FBasic8DataSet.LineItemRow newLineRow = this.fBasic8DataSet1.LineItem.NewLineItemRow();
newLineRow.RecNum = recnum;
Thanks Jon
Here is a code snippet I am using for SQLBulkCopy
string queryString = "SELECT `RecNum`, `Invoice Number`, `Date`, `Horse Name`, `Procedure Code`, `Procedure`, `Qty`, `AMOUNT`, `Cost` FROM `LineItem`";
OdbcCommand command = new OdbcCommand(queryString);
//Update Queries
lineItemTableAdapter1.DeleteWhereInvoiceNumberisNullQuery();
using (OdbcConnection connection = new OdbcConnection(connectionStringParadox))
{
command.Connection = connection;
connection.Open();
readerInv = command.ExecuteReader();
// Perform an initial count on the destination table.
OdbcCommand commandRowCount = new OdbcCommand("SELECT COUNT(*)FROM LineItem.DB");
OdbcConnection connectionRowCount = new OdbcConnection(connectionStringParadox);
commandRowCount.Connection = connectionRowCount;
connectionRowCount.Open();
long countStart = System.Convert.ToInt32(commandRowCount.ExecuteScalar());
MessageBox.Show("Total LineItem records" + Convert.ToString(countStart), Convert.ToString(countStart));
using (SqlConnection destinationConnection = new SqlConnection(destConnectionString))
{
destinationConnection.Open();
// Set up the bulk copy object.
using (SqlBulkCopy bulkCopy = new SqlBulkCopy(destinationConnection))
{
//Map columns
//SqlBulkCopyColumnMapping mapID =
new SqlBulkCopyColumnMapping("RecNum", "RecNum"); This maps the two colunms in question and causes errors becasue column types are incompatable. Source is autoInc(paradox Int) source is uniqueIdentifier.
bulkCopy.ColumnMappings.Add(mapID);
SqlBulkCopyColumnMapping mapInvNum =
new SqlBulkCopyColumnMapping("Invoice Number", "InvNum");
bulkCopy.ColumnMappings.Add(mapInvNum);
SqlBulkCopyColumnMapping mapPaid =
new SqlBulkCopyColumnMapping("Date", "DateWorkedOn");
bulkCopy.ColumnMappings.Add(mapPaid);
SqlBulkCopyColumnMapping mapInvTot =
new SqlBulkCopyColumnMapping("Horse Name", "HorseName");
bulkCopy.ColumnMappings.Add(mapInvTot);
SqlBulkCopyColumnMapping mapStat =
new SqlBulkCopyColumnMapping("Procedure Code", "ProcedureCode");
bulkCopy.ColumnMappings.Add(mapStat);
SqlBulkCopyColumnMapping mapDate =
new SqlBulkCopyColumnMapping("Procedure", "ShoeingProcedure");
bulkCopy.ColumnMappings.Add(mapDate);
SqlBulkCopyColumnMapping mapNotes =
new SqlBulkCopyColumnMapping("Qty", "Qty");
bulkCopy.ColumnMappings.Add(mapNotes);
SqlBulkCopyColumnMapping mapSatestx =
new SqlBulkCopyColumnMapping("AMOUNT", "Amount");
bulkCopy.ColumnMappings.Add(mapSatestx);
SqlBulkCopyColumnMapping mapcost =
new SqlBulkCopyColumnMapping("Cost", "Cost");
bulkCopy.ColumnMappings.Add(mapcost);
bulkCopy.DestinationTableName = "LineItem";
bulkCopy.NotifyAfter = 25;
bulkCopy.WriteToServer(readerInv);
bulkCopy.Close();
// Perform a final count on the destination
// table to see how many rows were added.
long countEnd = System.Convert.ToInt32(commandRowCount.ExecuteScalar());
MessageBox.Show("Total Line Item records copied" + countEnd);
|
|
|
|
|
First, do use code block formatting for code excerpts this large.
Jon Stroh wrote: it possible to use SqlBulkCopy when a uniqueIdentifier column is the first column in the destination table
You don't have to define the mapping for this column. SQL Server will generate a new calue for each row
Jon Stroh wrote: Also Is there a way to use this line of code some how with a datareader when each datareader record is added to the destination table?
recnum = System.Guid.NewGuid();
If you can execute that code in the statement, but most of the databases won't accept this. One way is that first you fill a datatable from the source then yu loop through rows and add GUID and after that you insert the data to the destination.
|
|
|
|
|
Hi,
I am using an interface a stepping through a list for my application to perform a method. (listed below)
foreach (IPetAnimalKeeper pettable in zooAnimals.OfType<IPetAnimalKeeper>())
{
pettable.pet();
}
Is there a way that i can then check the type of 'pettable' ?
reason being i would then like to call another method but would need to know the type first.
For instance if i wanted to call a 'move()' method.......i would need to know which animals 'move()' to call.
I've just tried putting in a 'break point' at the end of the 'foreach' and when i hover the mouse over 'pettable' i can see it's a Cat but if i code
pettable. i can only access the methods in 'pettable' not in the Cat class ?
Thats the methods i'd like access to.
Sorry, i know thats a bitconfusing.
Thanks
Neil
modified on Friday, December 5, 2008 12:48 PM
|
|
|
|
|
You can use one of the following methods to do that:
if (pettable.GetType() == typeof(myType))
{
...
}
if (pettable.GetType().Name == "myType")
{
...
}
if (pettable is myType)
{
...
}
But you probably shouldn't do it that way.
When you are looking for a certain method to call, you should always do so by using an interface. Avoid looking for a concrete type in your code wherever possible. This is bad coding style!
It is a far better solution to create another interface for each method you want to know about, exactly like you did it with the pet() method. This is one of the main purposes of the syntactical construct interface: They mark a type to have a certain member (i.e. method/property/event).
Regards
Thomas
www.thomas-weller.de
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. Programmer - an organism that turns coffee into software.
|
|
|
|
|
Thanks Thomas,
I'm new to interfaces so thats probably why i've left that way out just now (not too confident with them !).
Regarding the first option you gave, i understand how that works, but still cant see how it will allow me to access the methods in the animals own class....say Cat class ?
Can i cast the 'pettable' to instance of an object 'Cat' ?
|
|
|
|
|
nlowdon wrote: Can i cast the 'pettable' to instance of an object 'Cat' ?
Exactly.
Regards
Thomas
www.thomas-weller.de
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. Programmer - an organism that turns coffee into software.
|
|
|
|
|
Instead of that, have an interface that declares the Move(), and have your animals implement the IPetAnimalKeeper, but if your animal can move, also make them implement the interface IMovingPet
if (pettable is IMovingPet)
{
((IMovingPet)pettable).Move();
}
There are other ways, probably more elegant.
|
|
|
|
|
my programme needs something in a website. But to work it correctly, website should be loaded fully. so i thought that if i obtain the value of status bar "ready" or any number represents same thing, i can achieve the aim. So is there any function in .net that returns the value of status bar. thank you
|
|
|
|
|
You would have to search the windows of internet explorer through WinAPI. Enum all of the windows and check the text of the statusbar (the statusbar is a window that gets enum-ed) for the value that it should be.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
thanks for your answer but this seems a little bit hard for me without any code.
|
|
|
|
|
You will definitely have to research this more, I do not have any code handy. I am only guiding you in the right direction for your own research.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
If you use the WebBrowser component in the ToolBox, it'll fire a DocumentCompleted event that tells you when the page is done loading.
|
|
|
|
|
thank you senior i will try webbrowser component
|
|
|
|
|
that's right. it is working but in fact i need status bar variables on the classical internet explorer pages. because i am using virtual keyboard strokes and it is using some more components on explorer page. is there any dll to use internet explorer features. for example to add a new website to my favourite list.
|
|
|
|
|
kralece wrote: it is working but in fact i need status bar variables on the classical internet explorer pages.
You can't get them. They're not exposed by anything.
kralece wrote: is there any dll to use internet explorer features. for example to add a new website to my favourite list.
Yes and no. You don't get to control the full functionality of IE. For exmaple, there is no API call to create a Favorites entry. That's nothing but a shortcut created in the users Favorites folder with a URL in it instead of a file path. Other stuff is exposed by the WinInet[^] API functions.
|
|
|
|
|
thank you sir for your enlightening informations
|
|
|
|
|
Is there any tool to create a simple line diagram or other diagrams? If so, how can I get it/them?
I can't find any in the toolbox for Microsoft Visual C# 2008 Express Edition, Windows Forms Application.
|
|
|
|
|
|
That's great!
But I can't get the ZedGraphControl in the toolbox. I have added the zedgraph.dll just as it was written in the example you gave me, but I can't find it.
In the "Download C# Sample Project" I can see the control in the form and see the resulting graf if I run the program. But even their the ZedGraphControl is not in the toolbox.
Maybe it's because I use version 2008?
|
|
|
|
|
Yes i can do that
Follow next steps.
1.Rigth Click in general tool box, select option "choose items"
2.select tab .net frameworl componet
3. And the trick ... Click in Browse dll
4.Find and select dll ZedGraph.dll and drag and drop in general tool box
5.is done , now you can see zedgraph control and ready for you use
|
|
|
|
|
I have an application that uses a datagridview to display all the values in a particular datatable, while individual field values for the currently selected are shown in text boxes, comboboxes, etc. below the grid.
Anyway, when I call GetChanges() on the bound datatable, the datatable returned by the GetChanges() method often returns rows as modified even if all the current and original values in that row are equal. When I first load the application, this is not the case, but when I start navigating through the table, each row that I leave is marked as Modified.
Any advice regarding the cause and solution of this "error" would be appreciated.
Thanks.
|
|
|
|
|
Evning All,
Can anyone tell me if it's possible to fire an event (add components to a form) when you click on the tab of a 'TabControl'
I've learned that with other components in the form you 'double click' on say.....a button and it automatically takes you generated code that you can add to.
However, when designing the form you can't double click on an individual tab so i was wondering i there is such a feature.
Regards
Neil
|
|
|
|
|
There is probably a tab changed event or something. Another option may be to get the click event of the tab control and then figure out which tab was clicked.
|
|
|
|
|
Hi,
you want the TabIndexChanged event.
It handles the entire TabControl, not individual pages, so if you need code specific for each page you might want to insert a switch statement there.
|
|
|
|