|
Hi msogun,
Iam able to work with the simillar code without any error. It will be very easy if you can send the error message.
Iam using the following code:
adptr = new SqlDataAdapter("select * from employees", connstring);
adptr.Fill(ds,"employees");
adptr2 = new SqlDataAdapter("select * from employeeadd",connstring);
adptr2.Fill(ds,"employeeadd");
DataColumn col1 = ds.Tables[0].Columns["empid"];
DataColumn col2 = ds.Tables[1].Columns["empid"];
ds.Relations.Add("Employee Address",col1,col2);
SqlCommandBuilder bldr1 = new SqlCommandBuilder(adptr);
bldr1.QuotePrefix = "[";
bldr1.QuoteSuffix = "]";
SqlCommandBuilder bldr2 = new SqlCommandBuilder(adptr2);
bldr2.QuotePrefix = "[";
bldr2.QuoteSuffix = "]";
adptr.Update(ds,"employees");
adptr2.Update(ds,"employeeadd");
Regards
SGS
|
|
|
|
|
Is there any way to create an AVIStream in memory?
without having to write to disk?
I’ve tried using the AVIStreamCreate function from avifil32.dll, but it keeps returning an error.
I need to capture video from a webcam, to a compressed avistream.
And then send the compressed stream over an LAN.
This is the code:
<br />
AVISTREAMINFOW aviStreamInfo = new AVISTREAMINFOW();<br />
<br />
aviStreamInfo.fccType = _fccType;<br />
aviStreamInfo.fccHandler = _fccHandler;<br />
aviStreamInfo.dwScale = 1;<br />
aviStreamInfo.dwRate = _frameRate;<br />
aviStreamInfo.dwSuggestedBufferSize = _height * _stride;<br />
aviStreamInfo.dwQuality = 0xffffffff;<br />
aviStreamInfo.rect_bottom = _height;<br />
aviStreamInfo.rect_right = _width;<br />
<br />
<br />
_result = AviFile.AVIStreamCreate(out _aviStream, 0, 0, ref aviStreamInfo);<br />
<br />
_result returns -2147221164
|
|
|
|
|
Most likely you're not properly marshalling these types, or are using incorrect types during the AVIStreamCreate method. 2 questions I would ask, is are you sure that _aviStream should be an out parameter instead of a ref (i.e. do you need to create it first?). Second question, what type is _aviStream? Windows Media SDK specifies it should be a pointer to a PAVISTREAM. Make sure you've marshalled this type correctly, it should be the address of a pointer to an IAVIStream interface.
After looking further at the MSDN documentation, I see Microsoft recommends "you should not need to call this function. Some functions, such as CreateEditableStream and AVIMakeCompressedStream, use it internally." You ought to use one of those methods instead.
Tech, life, family, faith: Give me a visit.
Judah Himango
|
|
|
|
|
Question 1.
I've tryed this
<br />
[DllImport("avifil32.dll")]<br />
public static extern int CreateEditableStream(out IntPtr ppsEditable, int psSource);<br />
<br />
private IntPtr _aviEditable;<br />
private IntPtr _aviEditableCompressed;<br />
<br />
_result = AviFile.CreateEditableStream(out _aviEditable, 0);<br />
<br />
if(_result != 0)<br />
{<br />
throw new AviException("Failed to create editable AVI stream.", _result);<br />
}<br />
And it returns an address (eg. no error)
So i don't think i need to create it first.
BUT! it wont do
<br />
AVICOMPRESSOPTIONS EditablecompressionOptions = new AVICOMPRESSOPTIONS();<br />
<br />
EditablecompressionOptions.fccType = _fccType;<br />
EditablecompressionOptions.fccHandler = _fccHandler;<br />
EditablecompressionOptions.lpFormat = new IntPtr(0);<br />
EditablecompressionOptions.lpParms = new IntPtr(0);<br />
<br />
_result = AviFile.AVIMakeCompressedStream(out _aviEditableCompressed, _aviEditable, ref EditablecompressionOptions, 0);<br />
<br />
if(_result != 0)<br />
{<br />
throw new AviException("Failed to create editable compressed AVI stream.", _result);<br />
}<br />
But, if it is a file based avistream it works
Question 2.
The _aviStream is IntPtr
|
|
|
|
|
Have you looked at this page? I see that it uses some of the functions we're talking about, maybe you can gain some understanding from it.
Tech, life, family, faith: Give me a visit.
Judah Himango
|
|
|
|
|
Yep....I know it.....It's the lib i use.
|
|
|
|
|
I want to store some matrix-liked values.
The Column size is fixed to 4. And the Row size is not limited.
What method can i used?
|
|
|
|
|
Use a either a multidimensional array or a jagged array. See this MSDN article for more information.
I would suggest using a jagged array. To do matrix-like array with 4 columns:
// a jagged array, also known as an "array of arrays"
byte[][] myArray = new byte[4][];
Each element in the array will be another byte array. This will allow you to define rows, where each row is an array of values, and each row's size is independent of the size of other rows.
Tech, life, family, faith: Give me a visit.
Judah Himango
|
|
|
|
|
Experts,
I wish to display a C# DataGrid exactly as it appears on a C# Form after saving the DataSet to a file. The format (xml or html) does not matter (I'm assuming these are my only choices). The best I can do so far is:
1. call the DataSet.WriteXMLSchema method to create an xsl file
2. call the DataSet.WriteXML method to create my XML file
3. Create an XslTransform object
4. Load the xsl file via XslTransform.Load
5. Transform my ZML file to HTML via the XslTransform.Transform(source, destination) method
However, the HTML file does not contain any of the table formatting (since the generated xsl file doesnt contain table formatting). I realize I can create the XSL file by hand, but I was hoping there was a way to do it automatically such that table formatting is included. Any suggestions, either in creating an XML file with formatting or transforming a standard xml file to html such that formatting is preserved?
Thanks in advance.
|
|
|
|
|
I would add a new voice at the windows menu that appear if someone right click on whichever inputbox or textbox of whichever application running.
how?
|
|
|
|
|
I already answered your question on the previous page. Look into Windows Shell integration.
Tech, life, family, faith: Give me a visit.
Judah Himango
|
|
|
|
|
Yes but i've founded nothing about.
Can you show me some tutorial?
Furthermore i know it is possible add a new voice to the Windows context menu by RegKey. But i don't know where is the key value about rightclick context menu of Windows InputTextbox.
Thanks
|
|
|
|
|
|
yes but there is not explained how create a new key for right-click OF TEXTBOX.
It is not deducible by alone, i need some indication.
Sorry
|
|
|
|
|
Ah, my mistake, I misunderstood before as your English is not your first language.
For creating a context menu item that integrate into all TextBox controls in Windows, I cannot help you. It is possible, and will include Windows Shell integration, but I don't have any articles to point you to. Sorry.
Tech, life, family, faith: Give me a visit.
Judah Himango
|
|
|
|
|
Ok, thank you, but are there someone know that?
|
|
|
|
|
Yes. I suggest you post this topic in the forum again tomorrow.
If you do post again, use a different subject for your post. "how add new voices to the windows menu" is difficult for English speakers to understand. Instead, try something similar to "how to add a new option to Windows textbox context menu"
Tech, life, family, faith: Give me a visit.
Judah Himango
|
|
|
|
|
thanks friend!
|
|
|
|
|
I am not able to handle the shutdown event in my Windows Form Application. I tried writing an event handler for the shutdown event using session ending event handler provided in .NET. The code snippet for this is as follows. When such an event is fired this function doesn't get called.
private void ShutDown(Object sender, SessionEndingEventArgs e)
{
if (e.Reason == SessionEndReasons.Logoff || e.Reason == SessionEndReasons.SystemShutdown)
{
if (File.Exists(timeSheetFile))
{
if(DialogResult.Yes == MessageBox.Show("My application", "Do you want to do complete some task.", MessageBoxButtons.YesNo))
e.Cancel = true;
else
e.Cancel = false;
}
}
}
Instead a message box appears which displays "The application failed to initialize because the window station is shutting down".
Sachin Gera
|
|
|
|
|
The MSDN topic[^] of the SystemEvents.SessionEnding event (I assume you mean this one with shutdown event) states:
"If you are using SessionEnding in a Windows form to detect a system logoff or reboot, there is no deterministic way to decide whether the System.Windows.Forms.Form.Closing event will fire before this event.
If you want to perform some special tasks before System.Windows.Forms.Form.Closing is fired, you need to ensure that SessionEnding fires before System.Windows.Forms.Form.Closing. To do this, you need to trap the WM_QUERYENDSESSION in the form by overriding the WndProc function."
The example, which demonstrates how to do this in a deterministic way, is written in VB.NET but I guess you'll be able to understand and convert to C#.
www.troschuetz.de
|
|
|
|
|
i have created a client server application. after installing the deployed client application, it cannot connect to the server. but it could connect when ran using the solution. do i need to add anything to the deployment project to make it work? what could be the problem?
|
|
|
|
|
I want to write a program that monitor all key press on my computer, even when users are currently working with other program.
I've tried IMessageFilter interface but it didn't work, it do only when my applicantion got focus.
Anyone help me?
Thank you very much.
|
|
|
|
|
|
thank you stefan. I'm able to do it now.;)
|
|
|
|
|
Hello
i am getting muliple instances warning on the following line:
DirectoryEntry W3SVC = new DirectoryEntry("IIS://" + ServerName + "/w3svc");
how can I getrid of this?
-adnan
|
|
|
|