|
In the used Dataset (e. g. 'Dataset1') we have some colums with GUIDs /DSNs.
Within the Report-Layout we want to render the related Values to these GUIDs (e.g. the name to an Adress-GUID), which are kept in another table (e.g. 'adresses').
For example, we used the FoxPro-Report Engine in earlier times and there was a Command named 'SEEK', which pointed the cursor to en other destination! Is there something comparable in Reporting Service or how does it work the best way?
Thanks in advance for help !
|
|
|
|
|
Hi. (Firstly, sorry for my English)
I have a set of .dbf files (tables) in directory
I want to work with this files as database with ADO.NET
(c#)
I have no problem when reading data, but I can't change it.
For example, i have a file "test.dbf" in folder "d:\db".
The test.dbf is a table with 2 columns
- CODE (number[4])
- NAME (character[20])
The table has a one record (0,"joan")
I need to add a new record to this table (1,"alex")
Code:
<br />
string TableName = "test";<br />
string SelectString = "SELECT * FROM " + TableName;<br />
string DirectoryName = @"d:\db";<br />
string ConnectString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +<br />
DirectoryName + ";Extended Properties=dBase 5.0;";<br />
<br />
OleDbConnection myConn = new OleDbConnection(ConnectString);<br />
OleDbDataAdapter myDataAdapter = new OleDbDataAdapter();<br />
myDataAdapter.SelectCommand = new OleDbCommand(SelectString, myConn);<br />
<br />
myConn.Open();<br />
<br />
DataSet ds = new DataSet();<br />
myDataAdapter.Fill(ds, TableName);<br />
<br />
DataTable t = ds.Tables[TableName];<br />
<br />
DataRow dr = t.NewRow();<br />
dr["CODE"] = "1";<br />
dr["NAME"] = "alex";<br />
t.Rows.Add(dr);<br />
<br />
myDataAdapter.Update(ds, TableName);
myConn.Close();<br />
When I run "Update" method of OleDbAdapter
error occurs.
"Update requires a valid InsertCommand when passed DataRow collection with new rows."
I asked about this problem in russian forums many times,
but nobody can answer me exactly.
I understatnd that I have to specify the InsertCommand of OleDbDataAdapter but how I have to do it I don't.
Could you answer me, what "InsertCommand" must be or (it would be better) give an examle.
Thank you.
|
|
|
|
|
hi,
Here you are trying to update your data table with out any update command.
Suppose if you want to call like this
DataRow dr = t.NewRow();
dr["CODE"] = "1";
dr["NAME"] = "alex";
t.Rows.Add(dr);
myDataAdapter.Update(ds, TableName); // ERROR OCCURS HERE
myConn.Close();
You need to mention the update command. Other wise
it won't update the data.
So first define an update command for your data adapter.
This is also true for Delete, insert etc.
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
Are there any good resources out there for learning how to write ActiveX Controls? I am looking primarily for ones dealing with VC++ or C# (although from what I've read, traditional ActiveX isn't possible in managed code, only with .NET Framework installed on the client machine). I have searched a good amount on the web, but have been unsuccessful thus far in finding anything too useful to the Beginner.
Thanks.
|
|
|
|
|
This is not really the best forum for this question, but I'll answer as best I can...
By far the easiest language to develop ActiveX controls in is VB6.
You are correct that it is not possible to develop ActiveX controls in managed code (at least without some unsupported hacks). There are .NET equivalents though, both on the ASP.NET side and the WinForms side.
my blog
|
|
|
|
|
between:
SELECT * FROM
Blah1 as T1
INNER JOIN
Blah2 as T2
ON T1.ID=T2.ID
INNER JOIN
Blah3 as T3
ON T1.Id=T3.ID ;
vs.
SELECT *
FROM Blah1 as T1 ,Blah2 as T2,Blah3 as T3
WHERE T1.ID=T2.ID AND T1.ID=T3.ID ;
I've never really understood the advantage of the first syntax, and I'm always using the second syntax.
Marc
MyXaml
Advanced Unit Testing
|
|
|
|
|
The advantage of the first syntax is legibility. It visually and logically separates the evaluations that are specifically used to define the join(s) from the evaluations that are only used to filter the joined results.
Grim (aka Toby) MCDBA, MCSD, MCP+SB
SELECT * FROM user WHERE clue IS NOT NULL
GO
(0 row(s) affected)
|
|
|
|
|
If you have access to SQL Query Analyzer, type each statement and then Ctrl + L (Display Extimated Execution Plan).
This will display what steps the server will do and when you move the mouse pointer over each step it will tell you the estimated cost in CPU cycles, using the database current stats.
|
|
|
|
|
The first syntax is far superior in my mind, for the following reasons:
1) legibility
2) ease of maintenance - easily add/remove a join/condition
3) flexibility - it is easier to construct complex queries this way, especially those containing outer joins and/or complex joins.
I do think it is possible that the 1st syntax will lead to better optimized queries, because it gives the optimizer explicit information on what is a join and what is part of the WHERE clause. In a simple query it probably makes no difference, but once the query becomes complex, I'm sure it helps the query optimizer to know these things.
Final point on legibility - I usually write my queries something like this
SELECT *
FROM Blah1 as T1
INNER JOIN Blah2 as T2 ON T1.ID=T2.ID
INNER JOIN Blah3 as T3 ON T1.Id=T3.ID
which is much more legible.
my blog
|
|
|
|
|
Hi all. For what it's worth, the WHERE clause syntax for creating joins was part of the ASNI SQL/86 standard. The INNER JOIN / OUTER JOIN syntax became part of the ASNI SQL/92 standard.
In addition to the other comments made, the JOIN syntax also allows for more functionality, such as the FULL OUTER JOIN supported in some RDBMSs.
|
|
|
|
|
Greetings,
I have a combo box which I have bound to a datasource, and I want to remove the datasource so it doesn't have anything. I have to use it display some seperate text information.
(ie) How I set the datasource.
comboboxA.DataSource=DataSetTest;
comboboxA.DisplayMember="TableField1";
You can clear a datasource if you bind to a binding manager like this, and show 1 field at a time.
(ie) binding the object
comboboxA.DataBindings.Add("Text", DataSetTest, "TableField1");
(ie) To remove the binding you call.
comboboxA.DataBindings.Clear();
Is there an equivalent for removing a binding on a control while using a datasource?
Thanks in advance for any help!
|
|
|
|
|
hi,
Try this,
Combo.DataSource=null;
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
I have this code below, but I want the "Available" column to be the @@Rowcount specific to the GroupID. Right now with what I figured below, it subtracts the rowcount from both GroupID 859 and 860.
CREATE PROCEDURE usp_Groups
@StudyNo char(16)
AS
declare @Fill table (GroupID varchar(5), TesterID char(7))
declare @Ct table (GroupID varchar(5), TesterID char(7), Filled varchar(4))
declare @Out table (GroupID varchar(5), TesterID char(7), Filled varchar(4))
insert @Fill
SELECT DISTINCT tGroup.GroupID, tResultQue.TesterID
FROM tGroup INNER JOIN
tResultQue ON tGroup.GroupID = tResultQue.GroupID
where (tResultQue.QueStatusID >= '20') and
(tResultQue.QueStatusID <= '22') and tGroup.StudyNo = @StudyNo
insert @Ct
select distinct F.GroupID, F.TesterID, @@Rowcount as Filled
from @Fill F
Group by F.GroupID, F.TesterID
insert @Out
select distinct F.GroupID, F.TesterID, Ct.Filled
from @Fill F left join @Ct Ct on (F.GroupID = Ct.GroupID)
SELECT distinct tGroup.GroupID, tGroup.ScheduleStamp, tFacility.FacilitiesDescription, tGroup.NotToExceed, (tGroup.NotToExceed- Gonzo.Filled) as Available
FROM tGroup INNER JOIN
tFacility ON tGroup.FacilityID = tFacility.FacilityID left join @Out Gonzo on (tGroup.GroupID = Gonzo.GroupID) left join @Fill J on (tGroup.GroupID = J.GroupID) left join @Ct Cet on (tGroup.GroupID = Cet.GroupID)
where tGroup.StudyNo = @StudyNo
GO
*************************************************
This is what the output looks like:
GroupID|ScheduleStamp|FacilitiesDescription|NotToExceed|Available
-----------------------------------------------------------------
859|2004-02-24|Building A|15|11
860|2004-02-24|Building A|10|6
861|2004-05-04|Building A|10|NULL
***************************************************
This is what it should look like:
GroupID|ScheduleStamp|FacilitiesDescription|NotToExceed|Available
-----------------------------------------------------------------
859|2004-02-24|Building A|15|12
860|2004-02-24|Building A|10|9
861|2004-05-04|Building A|10|NULL
Thank You!
|
|
|
|
|
Oops, ok, problem solved.
Thank you.
|
|
|
|
|
Hello All
I want to get a list of all available SQL servers. And then the databases under each server.
Any Solution?
Sumit Domyan
Software Developer
ANALEC INFOTECH
|
|
|
|
|
|
I have been using the code found in the article: "Finding SQL Servers on the Network" to find any local MSDE/SQL Server installation as well as any remote sites. However, I have found that sometimes after MSDE is installed and the OS has been rebooted and the services indicate that it is up and running I have found that the code will not detect the local MSDE installation.
Sometimes, if I wait a while it will then show up. Sometimes it will never show up. Does anyone have any ideas why this might be??
Thanks,
Steve
|
|
|
|
|
MSDE takes a while to start, maybe that's your problem ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Hi, I am having a big problem with performance of the OleDbDataAdapter.Fill method on other computers than mine. I am using VisualStudio.NET 2003 to develop my application and it works fine on my computer, both in debug mode and when I build a release version and run that. However, if I set up the release version on another computer, it is extremely slow.
This is the code that fills my dataset
public DsDef getDefFiltered(int nIdVersion)
{
createDefDataAdaptersFiltered(nIdVersion);
DsDef dsDef = new DsDef();
daApplication.Fill(dsDef.tblApplication);
daLineType.Fill(dsDef.tblLineType);
daVersion.Fill(dsDef.tblVersion );
return dsDef;
}
My dataadapters are created like this. The conn object is an OleDbConnection object:
daApplication = new OleDbDataAdapter("SELECT * FROM tblApplication", conn);
None of the tables that are being fetched with the dataadapters have very many rows, the may vary from 10 to 150, so the amount of data shouldn't be the problem.
On my development machine this method takes 1.4 seconds but on another machine it takes 19.1 seconds. The same difference in performance applies to all other methods that use the OleDbDataAdapter.Fill method.
I have installed the .NET Framework on all machines and tried with both MDAC 2.7 SP1 and MDAC 2.8 installed, but still have this terrible performance.
Do you guys have any idea what might be causing this?? All suggestions are appreciated.
-Rotarinn
|
|
|
|
|
I believe I stumbled across the reason for this myself. The folder in which the application was installed to, included a non-english character in its name. By renaming the folder using only english characters, the problem disappeared and the performance matched the performance of my development computer.
|
|
|
|
|
hello friends
I want to read from a procedure. e.g. i want to read how much parameters a procedure is accepting? Any help, plz !
Sumit Domyan
Software Developer
ANALEC INFOTECH
|
|
|
|
|
This code should help. Set the variable @StoredProcedureName as appropriate.
select sc.* from sysobjects AS so
INNER JOIN syscolumns AS sc ON sc.id = so.id
where so.name=@StoredProcedureName
AND so.xtype='P'
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
Not getting the response you want from a question asked in an online forum: How to Ask Questions the Smart Way!
|
|
|
|
|
thanx a lot
it solved my problem.
Sumit Domyan
Software Developer
ANALEC INFOTECH
|
|
|
|
|
I am using sql server to copy data from oracle. So I use DTS to copy a table.
What I have done is use DTS Import/Export Wizard. And I have DTS packages which is schedule every day to update table. But the problem is all the data repeats in my new table in sql database instead of updating data.
Please give me some hint what I can do? and where can I go to learn abt it.
Thank you very much. sudeep
======
Yo need a brain to code.
|
|
|
|
|
You could add another SQL task to your DTS package which would execute a "TRUNCATE TABLE <tablename>" before your datapump step.
|
|
|
|