|
|
Hi,
As a beginning C# programmer I have some trouble getting this ODBC function to work.
<br />
[DllImport("odbc32.dll",CharSet=CharSet.Ansi)]<br />
private static extern short SQLGetDiagRec( <br />
short HandleType, <br />
IntPtr inputHandle, <br />
ushort RecNumber, <br />
string SqlState, <br />
short NativeError, <br />
String MessageText, <br />
short bufferLength, <br />
short TextLength );<br />
<br />
<br />
<br />
<br />
String messageText = string.Empty;<br />
short messageTextlen = 128;<br />
short nativeErr = 0;<br />
string sqlState = " ";<br />
short rc = SQLGetDiagRec(<br />
SQL_HANDLE_ENV, <br />
m_environmentHandle, <br />
1, <br />
sqlState, <br />
nativeErr, <br />
messageText, <br />
messageTextlen, <br />
128);<br />
Whatever I do, after all ODBC calls I make, sqlState will always show spaces and messagetext will always be an empty string
I guess I'm doing something wrong here, but can't begin to wonder what.
Is the declaration with DLLImport of this function not correct, is there something wrong with the parameters when the function is called ? Should I use pointers maybe (I thought in C# that was no longer necessary)
I hope some of the guru's can get me going on this
Thanks,
Shah
|
|
|
|
|
Anyone got any clues ?
please ??
|
|
|
|
|
how do i use WMI and how can i view a list of all the WMI classes. How does one use WQL statements? I know for a fac t that they are pretty similar to SQL syntax but what are the table names, column names etc?
|
|
|
|
|
|
|
ANYONE GOOD IDEAS?
I want to display Bitmaps with DirectX. I need a good performance, for that reason I'm not using GDI+. I load the Bitmaps into a Texture and draw them on Screen using the DrawPrimitives()-Method. It works fine for small Bitmaps.
But I need to display large Bitmaps (e.g. 5000x4000 Pixels), which cannot be directy loaded in ONE Texture. My graphics card supports textures up to 4096X4096 Pixels, which is even not enough And most of the common graphics cards don't support textures this size, right?
How can I split one Bitmap in different Textures so that I can display these Bitmaps? That was my idea, but I don't know how to do it.
Or does anyone have another idea of displaying Bitmaps this size?
I would be very greatful if anyone can help me!
Silka
|
|
|
|
|
silka_c# wrote:
I want to display Bitmaps with DirectX. I need a good performance, for that reason I'm not using GDI+. I load the Bitmaps into a Texture and draw them on Screen using the DrawPrimitives()-Method. It works fine for small Bitmaps.
Why don't you use something like BitBlt? GDI (not GDI+) is hardware accelerated and highly portable between cards. Not to mention easier to use for the kind of thing you're tring to do. It's often used on simpler, 2D games and it's fast enough for most uses...
I see dead pixels
Yes, even I am blogging now!
|
|
|
|
|
The Idea sounds good. I would give it a try.
I searched a little bit in the web and the MSDN.
How do I use BitBlt in C#. Did you use it in a c#-application and could you give me some code snippets?
Thanks a lot for your help.
Silka
|
|
|
|
|
|
Thanks again, Daniel.
I made BitBlt work but it is not much faster than the old version with DrawImage().
Are there any other ideas?
Thanks for your help.
SILKA
|
|
|
|
|
silka_c# wrote:
Are there any other ideas?
How fast do you need to go? 5000x4000 pixels == 5000x4000x4 bytes ~~ 76MB
This should take a while to transfer over any bus...
Besides that, do you really have a card/monitor that is able to display such a beast?
I see dead pixels
Yes, even I am blogging now!
|
|
|
|
|
Hi Daniel,
sorry, I've been on vacation for a while.
No, my monitor/ graphics card won't display the whole Image, that's why i started to think about resizing it to a moderate size.
Do you know, how I can do it in Direct Draw? I'm right now trying to figure out how fast it would be with Direct Draw (Managed DirectX 9.0).
|
|
|
|
|
I am wanting to have the current selected row highlighted. I have added a mouse click the datagrid for:
dataGrid1.Select(dataGrid1.CurrentCell.RowNumber);
and this is setting the row if I click on the grid, but if I click in a cell, the cell is going into edit mode and the row is not highlighted. I am trying to create a read only grid similar to a listview and then use an edit button or double click to show an edit form.
|
|
|
|
|
First of all: Please don't post two question with (nearly) the same topic.
Now to your question:
It is possible but you'll have to invest a bit of work. Create a class and inherit from DataGridTextBoxColumn. Override the Edit function and do nothing (do not call the base implementation). This will prevent the TextBox being shown and the Click event will reach the grid. If you also have a boolean column you will have to do the same with the DataGridCheckBoxColumn.
Finally you will have to make your own DataGridTableStyle so that the grid uses your new classes.
|
|
|
|
|
If you are using the class DataGridTextBoxColumn to create the columns of your datagrid then you can access the TextBox that receives the events from the DataGridTextBoxColumn to start editing text. You probably need to add a handler for the VisibleChanged event of the TextBox and if the state just became visible then send a escape keystroke and select the row instead, and finally, you can popup your form. Note that you can set both, the TextBox and the DataColumn to Readonly to prevent changes.
Hope that helps.
|
|
|
|
|
I have set the dataGrid.ReadOnly = True and this is preventing the values in the cells from being changed. However,is there also a setting to prevent the cell from going into edit mode when the cell is clicked?
|
|
|
|
|
Hello All,
I made a Component with Com+ and i market every class with the Just in time activation but. and i designed a windows form application to use this component. I added this component to my application with add refrences from the visual studio but when i try to use the application the programes hange.
Please any help if i did any error.
Regards,
Haytham
|
|
|
|
|
I am using textwriter to create a text document and writing information to it. I want to know if there is a way to format the text that I concatanate into the text that I send to the text document.
for instance: dr.writeline("Order Number" + (new ListItem(pr["ord_num"].ToString()));
I want to know if there is a way to make the text "Order Number" Bold so that it will stand out as a column.
|
|
|
|
|
That depends on what you use to view the text. There is no formatting of that kind for plain text.
---
b { font-weight: normal; }
|
|
|
|
|
I am using a TextWriter to create a text document that I am passing the information into. It would be nice to create a word document or excel document. I have not been able to find any information on creating those types of documents.
|
|
|
|
|
A simple TextWriter won't do what you want.
Have a look here. It's a library which should help you to generate a word document.
Another possibility would be to create a RTF document. Use the search function here on CodeProject. You should find at least one article about it.
|
|
|
|
|
If you write a word document, or a rich text document, or even a HTML document, you can make the text bold. HTML is probably easiest. A .txt file can't do that, it's plain text.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
A friend of mine point out to me to do it as an HTML, that is working much better than the text document.
Thanks to all
|
|
|
|
|
hi there,
i´m figuring out what´s the best way to check network services with c#?
i want to check if RDP and ICA Services are up on my servers. i tried
to just open a TcpClient and if it throws an exception on connect() i
guessed it´s unavailable. But thos didn´t work for me. it always throwed
the exception though the service was online. increasing timeout-values
didn´t work either.
i also tried connecting via System.Net.Socket but i gut the same results.
any ideas how i can check network services with c#?
best regards from .at
|
|
|
|