|
Could you give us a small piece of code of what you are trying to do?
You can do it on anything you choose - from .bat to .net - A customer
|
|
|
|
|
This is the example text of richtextbox that i want to save to a txt file :
1. xxx...(the new line)
xxx...(the new line)
2. xxx... (the new line)
xxx...(the new line)
.
.
.
(and so on)
The text in the txt file:
1. xxx...xxx...2. xxx...xxx...
So, this is the problem. Great thx for helping.
|
|
|
|
|
Hi,
I can't seem to locate a message box function for Web Based C#. Does anyone know how to do this, or have a Message Box control that I can add to my toolbox?
Thanks,
Glenn
|
|
|
|
|
There are no server controls for messageboxes in Web Apps. The closest you can do is use the alert() javascript in the client-side scripting
|
|
|
|
|
I have about 40 different dialogs that I would like to convert to a Form, because they are easier to work with and I don't have to write Win32 code to support them.
Does anyone know how to convert dialog boxes to C# Forms?
Thanks,
Glenn
|
|
|
|
|
I have a fairly large application that I want to add a web interface to. The application is designed as a two layer application. The user interface and the so called API, which does all the work.
I would like to be able to call the API which is written in pure C with no operating system dependencies except for telecommunications.
I have tried to add a reference in VS.NET to the API's .DLL but it doesn't allow me to.
Is there an easy way to do this with out converting the entire application to C#? For fun, I tried to compile it using VS.NET 1.1 as a C++ application and the 1st program out of about 200 gave me 100+ errors.
Converting it to compile under VS.NET C++ I thought would be easy, but would take too long. Anyone have any ideas??
Oh BTW, my compiler that I'm currently using for my C development is Watcom 10.6B. I know its old and unsupported but I understand it. I'm trying to learn VS.NET...
Thanks,
Glenn
|
|
|
|
|
You could try using P/Invoke, which would involve some [DllImport] usage. P/Invoke[^]
|
|
|
|
|
So, ehr...
..hope you won't think that this question is in the wrong forum, but..
You remember all the good'ol'SQL APIs like SQLConnect, SQLFetch, ... ?
How can I access those from a C# app?
I've tried to use the System.Data.SqlClient namespace stuff,
but that is targetted for SQL Server DBs,
and I am just trying to do something more ODBC-oriented (i.e. that would
work with other DBMS as well).
To be specific: I really, really, **really** need to
execute an SQL<foo> call (rather than using Data Sets, and such).
Is it possible in C#, or should I just go back to C++ ?
Suggestions anyone?
Thanks in advance,
F.O.R.
|
|
|
|
|
1. System.Data.OleDbClient
2. SqlConnection,SqlCommand and OleDbConnection,OleDbCommand can execute SQL statements. You can use an OleDbDataReader (SQlDataReader if MSSQL) to retun records in a fast forwar-only cursor and do as you wish with the data. xxxCommand and xxxConnection can also execute quries that have no return data or onlay a single scalar value.
Genius may have its limitations, but stupidity is not thus handicapped. - Elbert Hubbard
|
|
|
|
|
Thanks Rob,
but that's not exactly what I was looking for.
I suspect I'll end up moving to C++ one way or the other
Thanks again,
F.O.R.
|
|
|
|
|
Look at the System.Data.Odbc (only in 1.1) and System.Data.OleDb namespaces for setting up connections and executing commands etc.
The OdbcCommand and OleDbCommand objects both have the ExecuteNonQuery method (and more) to execute SQL statements without involving DataSet and DataTable objects...
|
|
|
|
|
Hmmm...
..I didn't know that 1.1 had an Odbc namespace!
I'll take a look, thanks
F.O.R.
|
|
|
|
|
While the previous answers were complete and technically correct, why do I still have the feeling you are using the wrong tool for the job?
You can do it on anything you choose - from .bat to .net - A customer
|
|
|
|
|
Because indeed I am.
I am looking for something that has a 1:1 correspondence to the sql.h library from C/C++.
Now, while C# has alternatiuve ways to achieve the same goals (all of the Data namespace, for instance), I am not surprized to find that C# keeps you away from such low level kind of stuff.
It indeed makes much more sense for me to use a C++ (managed or not) app in this case,
but I figured I could look around for a bit before giving up on being more modern
F.O.R.
|
|
|
|
|
OK, before I give up on this, let me rephrapse the question
Any way I can stick in a C# App the following lines?
<br />
sqlr = SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &h_env);<br />
sqlr = SQLSetEnvAttr(h_env, SQL_ATTR_ODBC_VERSION, (SQLPOINTER)SQL_OV_ODBC3, SQL_IS_UINTEGER);<br />
and other statements like that ?
They are taken from a C/C++ app that includes <sql.h> and <sqlext.h>.
Maybe I can place them in an un-managed section?
It would solve soooo many problems !
Thanks in advance for any input,
F.O.R.
|
|
|
|
|
This is just a shot in the dark but you could take a look at addng a COM reference to the Microsoft SQLDMO Object Library. You might find what you need in there.
|
|
|
|
|
if anyone have a good idea about how to creat an html to image component
i tried :
A.
capture a web browser controll
prob
1. a win form app , we need to put the web controll inside A dll file. and that a little messy ...
2.when u capture it will only get what u c ...
and not the whole page.
B.
generating a url file on the server
then open this file with the windows shell getting the
image that gnerated by the server
prob. wont work on windows 2003 server.
Any help or idea would be most welcome !
|
|
|
|
|
try to start search from here:
Thumbnail Generator Web Service
Description: The Thumbnail Generator Web Service creates a .gif image of a specified URL.
<br />
http:
<br />
http:
Found from here:
<br />
http:
"I have not failed.
I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)
|
|
|
|
|
thnx for the reply,
i alrady tried the web service , its very nice but wont work on the 2003 servers, or xp machine u get an exception when u try to extract the image with the iextractimage interface ,
the same code work with win 2000 wont work with 2003 ...
|
|
|
|
|
Never saw this on work Sorry - once I've searched the net for this info and this what I found. Never used it and didn't know if this work.
P.S. This is strange that some interfaces (!!!) doesn't work somewhere May be it's depends on browser version ??
"I have not failed.
I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)
|
|
|
|
|
I have seen several helpful examples of how to call API functions but I am confused about translating the data types. For example, I have seen DWORD parameters translated to both int and uint in c#. I am using a function that has a char[] parameter which I think should be translated as sbyte, but I'm just not sure. Any direction on a good reference for this?
Tym!
|
|
|
|
|
Try this: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cscon/html/vclrfcomparisonbetweenccsharp.asp
Glenn
|
|
|
|
|
|
I have a richtext control, is there a way to count number of words or do I make my own function?
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
This will work assuming only one space is between each word:
this.richTextBox1.Text.Trim().Split(" ".ToCharArray()).Length;
|
|
|
|