|
When I add a DataGrid to a form and associate it to the datasource, all the columns are retrieved from the table.
This is fine, but I want to rename those columns. How to do that?
Ex: Columns in table are:
PurchaseDate, MeterReading,....
I want to display the columns in the DataGrid as Purchase Date, Current Meter Reading ...
"...if you don't want to hear things that piss you off don't piss off other people. SIMPLE." - Steven Hicks This signature was created by "Code Project Quoter".
|
|
|
|
|
|
Sorry I forgot to mention, the DataGrid was in Windows Forms, not WebUI.
Mark Nischalke wrote:
Turn off the autogenerate columns and add the columns
The AutoGenerateColumns property is only for WebControls.
This is my first take at ADO.NET
"If a jug falls upon a stone, woe to the jug. If a stone falls upon a jug, woe to the jug. Always woe to the jug"." - KaЯl This signature was created by "Code Project Quoter".
|
|
|
|
|
I am trying to pass an array to an oracle procedure using the OracleClient for .NET. I can't find away to do this/ I have trawled the net and have found a few people trying to do the same thing but no solution. The only solution given was to pass the array as a delimited string, but this is no good for my purposes as the array could get quite large.
Thanks in advance for any suggestions
Ian
|
|
|
|
|
I am having trouble installing MSDE. I am attempting to launch the installation via another setup program I am writing. This setup will install a lot of prerequisites that another app needs, one of them being MSDE.
The problem is that when I launch the MSDE installation all goes well until a little over half way through, when it just hangs. Nothing happens, ever. I can do this repeatably. I can call the setup.exe from C#, MC++ using .NET and using Win32, and also straight Win32. All cause the installation to hang.
It seems to have to do with waiting for the process to finish, because if I don't use Process.WaitForExit or WaitForSingleObject the installation will continue and finish even if launched from my app. But calling these functions causes a hang.
Here is another post about Delphi: link[^]
Here is a Win32 DLL function that I wrote (took from the above post, he said it worked for him) that causes the problem.
<code>#define APPLICATION NULL
#define COMMANDLINE _T("MSDE\\Setup.exe sapwd=testpassword")
#define CURRENTDIR NULL
extern "C" __declspec(dllexport) int NativeLaunchMSDEInstaller()
{
STARTUPINFO si;
PROCESS_INFORMATION pi;
DWORD dwExitCode;
BOOL br;
ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
br = CreateProcess(APPLICATION, COMMANDLINE, NULL, NULL,
FALSE, 0, NULL, CURRENTDIR, &si, &pi);
if (br)
{
CloseHandle(pi.hThread);
WaitForSingleObject(pi.hProcess, INFINITE);
GetExitCodeProcess(pi.hProcess, &dwExitCode);
CloseHandle(pi.hProcess);
}
else
{
return GetLastError();
}
return 0;
}</code>
Thanks for any help (or atleast a verification that this is a problem),
Nathan
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
hello,
here is a problem i am facing.
i have a from DATE column in my table and i have a to DATE column.
i have values in from DATE column, but nothing in to DATE column.
now i want to put the values in such a into to DATE column that second value i.e value in second cell is assigned to first cell in to DATE columns and then 3rd to second of to DATE column and so on.
and at the final cell the current date.
I am using sql server2000
i can show it like this.
from to
2003-07-08 17:01:00.000 2003-08-08 17:01:00.000
2003-08-08 17:01:00.000 2003-09-08 17:01:00.000
2003-09-08 17:01:00.000 2003-10-08 17:01:00.000
2003-10-08 17:01:00.000 current date i.e. todays
Asim
|
|
|
|
|
Hello,
We're upgrading our application to use SQL Server, having used Access for some time and I need some insight, as I may have to redesign the tables.
The application is a web based front-end for our data. In the Access version, we have a completely separate database for each Client/Project who logs on, each database had the same structure. It is easier to deal with things when they had this both physical and logical division.
There is some data duplicated between the databases, and this must be manually copied, usaully when the database is first created.
Is SQLServer designed to allow multiple databases to exist independently, but still allow some common data to be shared, and also allow Stored Procedures to be shared among the different but same structured databases.
Perhaps we should go the way of combining everything into one database however I would really prefer to store them independently. I understand that Oracle may have something like this in the way of folders.
I'd appreciate any words of wisdom.
Thanks,
John
|
|
|
|
|
I would advice keeping all the data in the same database as that makes maaging the databases like backup etc. easy. Else if you want to stick to the multiple database option, you can definately store the common data in a common database and then acess the tables using notation [Common DB Name].[Table Owner].[Table Name]. As far as stored procedures are concerned, I would recommend keeping copy of same in all databases as using three part concvention as mentioned above will make the stored procedures creepy and bad performing.
Gaurav
|
|
|
|
|
Does anyone have, or know where I might be able to download a version of an MDI application that binds with Access97?
If you do, I would be indebted to your sense of helping another member of your kind, since AppWizard will NOT create ANY application using Access2K, and I don't have Access97 (which was the last version of Access that AppWizard supported for such kind of things).
Thanks.
William
Fortes in fide et opere!
|
|
|
|
|
Only the data that is queried in the query is sent to the client and not the entire database. So you need not worry about this.
Gaurav
|
|
|
|
|
When you submit a query to the engine, the engine processes the query and checks which are the tables / records that need to be read.
Gaurav
|
|
|
|
|
hi all,
I am VC++ Programmar. We are facing Problem of Storing Images into oracle as Blob data type.Did VC++.Net oR ADO.net Helps to Store Images in Oracle Database as
Blob Datatype.
I need Help
NB:Very Urgent
Thanks In Advance
|
|
|
|
|
|
hi Mark,
Thanks For Replying.
Really I check That Article.It is Storing Images in C Sharp
I want To Store Images in Oracle Database Using VC++.Net
I am VC++ Progrmmar. I am Unable To Store The Images IN Oracle Database Using VC++ 5.0 So I need To Know and Conform
From any Dot.Net Programmars That Through VC++.Net Or VB.Net
WE can Store Images.Then I Can Recommend Company To Buy VC++.Net Or Related.
|
|
|
|
|
Just because it was written in C# doesn't change the underlying techniques.
Create a file stream, read the the image bytes into the steam, assign stream to store procedure variable, execute the procedure.
|
|
|
|
|
I need to Export Fields in a table into another Database Table on a Remote machine, at the moment I Export the records one by one and delete the records as I go along. This is very slow over a 28k connection that I need to use.(3 records per second or so, I am dealing with 1000s of records)
I would love to take all the records at once, dump the on the remote machine and then delete the lot!
I can make use of a Dataset to get all the records but how do I specify what and how to export this to another connection???
Leon v Wyk
|
|
|
|
|
Option 1: write a program to do it.
Option 2-n: depends upon the database platform you are using. For example, SQL Server has very powerful data transfer mechanisms built in, such as DTS and RPC which can run on a scheduled basis.
onwards and upwards...
|
|
|
|
|
These are the steps in script that u'll be needing-
- BCP out the data into a text file.
- FTP the file to the remote location.
- Insert the file in remote database using remote stored procedure.
- Delete the records from source database.
Hope this helps.
Gaurav
|
|
|
|
|
This is a fairly old thread, but I just stumbled across it looking for an answer to a distributed transaction question I have.
Anyway, does your export procedure need to be transactional? i.e. Do you want to ONLY delete the source records once they are in the remote system? And do you want the destination records to ONLY be valid once they are deleted from the source?
I have architected many systems like this where the data needs to be in one place OR the the other but not both, and not get lost, like in this example.
while (there are more records to export)
{
begin transaction;
try
{
export record to remote system;
delete record from local system;
commit;
}
catch ()
{
rollback;
}
}
These systems are hard to accomplish, sometimes you are better off assuming that the 2 systems are only going to communicate asychronously and then revisit the problem you are trying to solve.
If that doesn't help you one iota I won't be too suprised.
JBoy
|
|
|
|
|
I have a table as such:
rowID - rowParentID - rowTitle
rowID = Indentifier
rowParentID = is the parent of the row. Means that it belongs below the row that has rowID = rowParentID.
I need to show all rows in a tree view style in ASP.NET
I am new to SQL so any help will be usefull. I have no idea how to do this in stored proceedure..
|---------------|
| theJazzyBrain |
|---------------|
|
|
|
|
|
I have no idea about C++/MFC but I think that I shoulf be able to understand the logic at least...
Yeah, please send it to jason@skc.gr
Thanx alot
|---------------|
| theJazzyBrain |
|---------------|
|
|
|
|
|
I made an application in Visual C++ that uses ADO to connect to SQL server. My application is multiple threaded, there are five threads and each thread has its own connection object.
Someone told me that this way of making connection is not too good and that i should use connection pooling.
Can anyone tell me what is connection pooling in ADO ? How can i use it ? Is there any resource from where i can learn how to use ADO connection pooling ?
|
|
|
|
|
VC++ 6.0 and Access 2000 don't go hand in hand. IOW, you cannot develop an application using VC++ 6.0 AppWizard if the application will be using Access 2000. (Microsoft saw to that!!!!)
If you have a database application that already exists, there is some hope for getting it to use Access 2000, but if you are just developing it, AppWizard will NOT do it for you (meaning, you will bomb out where it asks for a Data Source.)
Has anyone gotten this experience and found a way of creating a new application and then somehow get it to work using Access 2000?
Thanks.
William
Fortes in fide et opere!
|
|
|
|
|
If you use the standard ODBC driver, then you shouldn't have any problems. I have not used the MFC CDatabase/CRecordset classes in years because they are limiting and crappy. You may consider using your own ODBC class wrappers.
onwards and upwards...
|
|
|
|
|