|
hi everyone
my problem is that i can't update any field in the datalist ..i use the update event handeler ...when i try to update any field ...the field remains with its initial value...and when i debug the page...i noticed that the value of
((TextBox)cell[x].cotrol[0]).text is equal to ""..that it can't feel the value i insert...how can i solve this..
thx alot
|
|
|
|
|
1.can i create a table from stored proc?
2.can i insert/delete/update a table from sp?
3.wots that extended sp can do that ordinary sp cannot?
NOTE: I dont have access to SQL server of any type.
|
|
|
|
|
xcavin wrote:
NOTE: I dont have access to SQL server of any type.
Then what do you care?
1) Yes
2) Yes
3) Extended sp can access non-TSQL code and therefore system resourses other than the SQL Server itself.
|
|
|
|
|
Michael Potter wrote:
Then what do you care?
Learning SQL programing without access to SQL server.
Coz nothing can stop me.;)
|
|
|
|
|
xcavin wrote:
Learning SQL programing without access to SQL server.
Then how will you know you are learning correctly?
Why now download MSDE and use that? Or if you want to learn all the GUI tools also there is also a 120 day trial you can download also.
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
The Second EuroCPian Event will be in Brussels on the 4th of September
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
|
|
|
|
|
Hi
I'm going to try to explain what i'm trying to do and if someone is able to give pointers on what i'm doing wrong i would be very grateful.
The app has one background task (service) and one configure application.
The background service loads a typed dataset from a sql server on startup and copies it to the remoting object with DataSet.Merge() wich exposes this over remoting.
settings.TrendTags = sql.GetTrendTags();
RemoteSettings.TrendTags.Merge(settings.TrendTags);
RemotingServices.Marshal(RemoteSettings, "Trend");
This seams to work ok. After Merge() both datatables count property returns the same. (2)
I then load the DataSet in the client app and copies it to a local dataset for modification
Reason for not using the remoting object directly is the inability to see properties while debugging.
settings = (SrvSettings)Activator.GetObject(typeof(SrvSettings) , "tcp://localhost:4188/Trend");
LocalSettings.TrendTags.Merge(settings.TrendTags);
Also this works ok. LocalSettings Contains the full recordset.
Then the user edits the recordset with something like.
TrendTable.TrendTagsRow tr = (TrendTable.TrendTagsRow)LocalSettings.TrendTags.TrendTags.NewRow();
tr.SomeProperty = "Something";
LocalSettings.TrendTags.TrendTags.Rows.Add(tr);
LocalSettings.TrendTags.TrendTags.Count now reports one more.
I then try to apply this change to the remoting object with
settings.TrendTags.Merge(LocalSettings.TrendTags);
I've tried some different things but DataTable, DataSet GetChanges ApplyChanges() etc...
but i cannot with merge get the added row to go into settings wich is the remoting object.
I've done the exact same thing twice before with success but this time it refuse to work.
Anyone know why?
Fredrik Högberg
|
|
|
|
|
Hey guys, what am I missing here? System.Data.OracleClient gets installed with .NET Framework 1.1, correct? If I set up a "using System.Data.OracleClient;" in my C# code, I get an error message that says "The type or namespace name 'OracleClient' does not exist in the class or namespace 'System.Data' (are you missing an assembly reference?)".
I looked in C:\windows\Microsoft.NET\Framework\v1.1.4322, and yes, there is a System.Data.OracleClient.dll file. So I think I'm missing something easy... anybody come across this yet?
Oh the PC is Windows XP Pro, and I'm using Visual Studio 2003 Enterprise Architect, with .NET framework 1.1 - the 1.0 framework has never been installed on this PC (the computer is one month new). If, inside of the VS.NET IDE, I start typing "using System.Data.", Intellisense only shows me choices of "Common, Odbc, OleDb, SqlClient, SqlTypes". OracleClient isn't on the Intellisense list, but even if I force-type it, I still get that build error.
Thanks!
-Thomas
|
|
|
|
|
Looks like you have not added the reference to System.Data.OracleClient.dll. Check it out
Bhaskara
|
|
|
|
|
Yep, that was the problem. Just had to right-click "references" in the project window, and say "Add"!
-Thomas
|
|
|
|
|
Hi,
I'm in a situation where my VB.NET code will know the name of a database, and can connect to it, but needs to get the mdf and ldf file names for that database. Is there a property of some ADO.NET object that will tell me the file names? Or maybe a query to run to get the file names?
Thanks
David
|
|
|
|
|
In the master database there is a system table called sysdatabases which gives the full path to the primary file of each database. In each database itself there are two system tables that would be useful to you the first is sysfilegroups which joins to sysfiles . It is sysfiles that actually contains the list of files for the database.
If you need more information the SQL Server books on-line should fill in all the details you need.
Does this help?
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
The Second EuroCPian Event will be in Brussels on the 4th of September
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
|
|
|
|
|
That's exactly what I needed, thanks!
David
|
|
|
|
|
is there some way to convert a access database to a mysql ? I am not interested in expensive tools , as i can not pay for this .
|
|
|
|
|
The only technical thing I know about Access is that it never should have been written. Even MSDE is better than Access! To be safe, I'd export the Access database as a CSV file, manually create your schema inside MySql, and then tell MySql to import the CSV file. It's a little more work then a fancy point & click tool, but you know your data will go through perfectly.
-Thomas
|
|
|
|
|
Hi,
Take a look at this: http://solutions.mysql.com/software/?item=98[^]. It's from the MySQL website. Although the tool is shareware, you might be able to convert with the demo version. I haven't looked so I'm not sure if they disable it in the demo version.
In any case, there are tools, so if that doesn't work, you can look elsewhere on the MySQL website or on Google.
Sincerely,
Alexander Wiseman
Est melior esse quam videri
It is better to be than to seem
|
|
|
|
|
Consider the following:
Database name - junkDB
Table name - junk
Fields - 1) slno char(10)
2) name char(20)
3) message char(200)
4) date_time datetime
the 4th field is of type datetime. (eg: 07/20/2004 5:30:45 PM)
i am connecting to the database using VC++ (SDK), using the #import (msado15.dll) statement.
when i retrieve the date_time field, i get a floating point value (somewhat like this 37842.4578131)
can someone help me with this. how can i retrieve the datetime field properly.
thankyou,
Deep George Zachariah
|
|
|
|
|
deep_george_zach wrote:
i get a floating point value (somewhat like this 37842.4578131)
Possibly the number of days since 1/1/1901
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
The Second EuroCPian Event will be in Brussels on the 4th of September
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
|
|
|
|
|
is there any way to get the datetime directly....
if no, then how do i convert the floating point number into date...
any idea ??
thankyou
Deep George
|
|
|
|
|
Use the Format() method to format it in whatever way you want. Like Format("%Y-%m-%d") formats it to Year, Month and Day format. Format method is member of CTime class.
|
|
|
|
|
Hi there,
I have generated some SQL script-files using the SQL-Enterprise Manager (for
creation of tables, stored procedures, etc.).
When running those script files through the isql or osql utility, I have the
possibility to capture the output to a file, which is sort of importand to
me.
What I'd like to do is to write a small utility (Windows app in c#) which
will execute my sql-script-files on the SQL server. Again, I need to capture
the output. Can this be done using an SqlCommand-object providing the
contents of each individual script-file as the command text or do I have to
use isql. In both ways I'd like to know how it is possible to capture the
output.
The output is actually only required if there have been errors during
batch-execution.
Any help is greatly appreceated. Thanks in advance.
Matthias
If eell I ,nust draw to your atenttion to het fakt that I can splel perfrectly well - i;ts my typeying that sukcs.
(Lounge/David Wulff)
www.emvoid.de
|
|
|
|
|
isql has output parameter : /o
public int Exec( string sCommand )
{
int nResult = 0;
m_oInstallProcess = new Process();
m_oInstallProcessInfo = new ProcessStartInfo("cmd");
m_oInstallProcessInfo.UseShellExecute = false;
m_oInstallProcessInfo.RedirectStandardInput = true;
m_oInstallProcessInfo.RedirectStandardOutput = true;
m_oInstallProcessInfo.RedirectStandardError = true;
m_oInstallProcessInfo.CreateNoWindow = true;
m_oInstallProcess.StartInfo = m_oInstallProcessInfo;
m_oInstallProcess.Start();
m_oCommandWriter = m_oInstallProcess.StandardInput;
m_oResultReader = m_oInstallProcess.StandardOutput;
m_oErrorReader = m_oInstallProcess.StandardError;
m_oCommandWriter.AutoFlush = true;
m_oCommandWriter.WriteLine( sCommand );
m_oCommandWriter.Close();
m_oCommandWriter = null;
string s = m_oResultReader.ReadToEnd();
m_sErrorMsg = m_oErrorReader.ReadToEnd();
if( s.IndexOf("Cannot open input file") > 0 )
throw new Exception( "Command:\r\n"+sCommand+"\r\nError:\r\nCannot open input file!" );
else if( m_sErrorMsg.Trim().Length > 0 )
throw new Exception( "Command:\r\n"+sCommand+"\r\nError:\r\n"+m_sErrorMsg+"" );
else
System.Threading.Thread.Sleep( 10 );
return nResult ;
}
D!shan
|
|
|
|
|
Hi D!shan,
thanks for your reply! Your example, which I find extremely interesting is unfortunately not, what I was looking for, because it assumes, that the person running my tool is required to have osql installed on his/her machine.
So I was actually looking for a way to do this through an SqlCommand object. What I've done now is that I've written a parser for SQL script files, which creates a queue of individual commands which can actually be executed through the SqlCommand. Now I'm looking for a way to hook up the output from Sql-Server when doing ExecuteNonQuery()...
Regardless of that, I find your code very useful for many other situations. Be sure of a good rating and thanks a lot.
Matthias
If eell I ,nust draw to your atenttion to het fakt that I can splel perfrectly well - i;ts my typeying that sukcs.
(Lounge/David Wulff)
www.emvoid.de
|
|
|
|
|
Hi!
I'm being plagued by the dreaded Jet error 3218 "Couldn't update; Currently locked" from time to time.
My application is a windows service that instatiates a server object that's being published for remoting using RemotingServices.Marshal(myObj, myURL) .
This server object receives requests from remoting clients and reads and writes to an Access 2000 database using OleDb. In addition, the server object performs some actions at the tick of a System.Timers.Timer, reading and writing to the DB as well.
Now sometimes I get this error 3218, even when there are just 1 or 2 clients connected and I can't explain why this is happening.
I'm not using any transactions, so I can't see why any recordset should be locked for a longer period of time.
I also Dispose() of all OleDbConnections as soon as the query is through, thus accumulation of open DB connections shouldn't be an issue either.
Does anyone have an explanation or, even better, a clue on how to avoid this error?
TIA,
mav
|
|
|
|
|
|
Thank you Anders for your reply!
I'm closing all connections already. In fact I only closed the connections in the beginning without disposing and then read somewhere that this might be the reason. So I disposed of all connections after closing them, but to no avail.
I know it might sound silly, but just to make sure I'm not misinterpreting the whole situation, can somebody confirm this:
1) Several threads are accessing the database, so there's the possibility that two or more queries are started simultaneously.
2) I set the locking mode to row level locking in the connect string, so a collision should ONLY be possible when two threads try to access the same row in the same table and at least one of them is writing.
3) When such a collision occurs the DB retries for the number of times specified in the access db (I set it to 10), waiting for the period specified (250ms) every time.
4) So the writing update is taking > 2,5 seconds to complete and at the same time there's a reading access to the same row?
If these assumptions of mine are correct, then reducing the tries/interval should increase the probability of getting a 3218, right?
mav
|
|
|
|