|
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.
|
|
|
|
|
Hi everyone
i am new in writing stored procedure and calling them from .net
can anyone tell me about a link to an ebook or articles about stored procedure.
thanks.
|
|
|
|
|
|
Friends,
I am running SQL server on my machine which is present in a LAN environment. Some one on the LAN, accessed my SQL server and deleted the data.
What i want to ask is that whether SQL server maintains any kind of laog that who tried to connect it and what query the client executed ? If yes, that how can i view this information. Is there any other alternative ? What i wnat to know is that who connected to my SQL server and what query request came from that machine ?
Imtiaz
|
|
|
|
|
I have problem with this query..
it is taking too much time to fetch the records ..
can anybody tell me general solution on this.
is their any problem in any join ?
i have main problem in the following condition
( (b.cenid = c.cenidr and b.polyid = c.polyidr)or(b.cenid = c.cenidl and b.polyid = c.polyidl))
if only one condition is used then it gives result very fast
so
help me ..
SELECT a.laname, a.cfcc, b.cenid, b.polyid, c.tlid, d.fename, d.fetype, d.frlong as d_frlong, d.frlat as d_frlat, d.tolong as d_tolong, d.tolat as d_tolat, p.polylong, p.polylat, p.water ,e.rtsq, e.long1, e.lat1, e.long2, e.lat2, e.long3, e.lat3, e.long4, e.lat4, e.long5, e.lat5, e.long6, e.lat6, e.long7, e.lat7, e.long8, e.lat8, e.long9, e.lat9, e.long10, e.lat10 FROM ((((
( rt7 as a inner join rt8 as b on a.land = b.land )
inner join rti c on ( (b.cenid = c.cenidr and b.polyid = c.polyidr)or(b.cenid = c.cenidl and b.polyid = c.polyidl))
)
inner join rt11 as d on c.tlid = d.tlid)
inner join rtp as p on p.cenid = b.cenid and p.polyid = b.polyid ))
left join rt2 as e on d.tlid = e.tlid
WHERE a.laname like 'Mill Pond%' and
(( 3958.682 ) * ( acos( sin( (d.frlat) * 0.01745 ) * sin( ( $latc ) * 0.01745 ) + cos( (d.frlat) * 0.01745 ) * cos( ( $latc) * 0.01745 ) * cos( (d.frlong - ($longc) ) * 0.01745 ) ) )) <=$mile
ORDER BY a.laname
|
|
|
|
|
Writing a GIS System?
From my experience trig functions are expensive so you should cut down the amount of data that has to be calculated. To do this, recreate your existing query (without the trig functions) as a subquery, replacing the trig functions with a very basic bounding box - this will cut out a vast quantity of data quickly. You are now left with just a subset of the original data, your outer query can now perform the trig operations on a much smaller set of data.
As for the joins, I'm assuming that these id fields are all primary keys and indexed by default, you may want to index the foreign key side of them to see if it speeds up the query also.
However, from experience, I'd say the trig functions are where your bottle neck is.
"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!
|
|
|
|
|
Try using UNION to solve the INNER JOIN condition.
Here's how it should be like:
SELECT ...
FROM ...
INNER JOIN rtiC ON b.cenid = c.cenidr AND b.polyid = c.polyidr
...
UNION
SELECT ...
FROM ...
INNER JOIN rtiC ON b.cenid = c.cenidl AND b.polyid = c.polyidl
...
|
|
|
|
|
This line of code
myDataSet1.ReadXml(mySqlCommand.ExecuteXmlReader(), XmlReadMode.Fragment)
-------------------------
throws this exception,
Invalid Operation exception:The operation is not valid due to the current state of the object.
--------------------------
mySQlCommand is a Select statement with 'for XML auto'.
|
|
|
|
|
Just curious, why are you populating your dataset from SQL Server via XML? It is a most inefficient way of populating a dataset. First SQL Server has to convert its data to XML, send it to your application, which then has to parse the XML and place it in the dataset. It would be much better to use a DataAdapter to populate the DataSet.
"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!
|
|
|
|
|
Mr. Mackay;
Many thanks for replying.
I know it is not the best way. The reason, I tried to do this was to test the proof of principle. In order to use the ReadXML method, the command has to bring XML Data and this is the reason for the 'for XML auto' statement.
From the trace, I feel this exception has to do with System.Exception and probably to some 'postback' related problem. I would whether you can point to trouble shoot this.
Thanks
Jay
|
|
|
|
|
Hi all. I've run into an interesting problem. I have a need, with a single selected row in TSql, to count the number of columns with a NULL value (or conversly, the number of columns with a non-null value entered). The table from which the row comes is likely to see changes in its structure over time; adding to the complexity of this need, for simplicity in maintenance, it would be useful not to have to hardcode the column names (I'm thinking of hardcoded "CASE" statements here...)
Does anyone have any suggestions? Ultimately, a user-defined function that, given the primary key value identifying a single row, would return the number of Null values (or non-null values) across the columns in that row would be ideal. I'm hurting my brain on how to get there.
|
|
|
|
|
Greetings,
I have a textbox which I have bound manually (through code) to a database field, and it displays the text correctly. But when I call "myTextBox.Text;" it doesn't have any text found in it, but it shows up on the windows form textbox correctly, but when I call the ".Text" property it isn't there. Is there something I have to manually do to get the text from the bound control?
I am using C# from 2003 studio on a windows xp system, and
here is an example of my code which I called to bind the textbox.
"myTextBox.DataBindings.Add("Text", myDataset1, "TextboxTestField");"
Thanks in advance for any help.
|
|
|
|
|
The only solution I could find on my own was to catch the change text event for the Text box which I had bound to the database field. When the event happened it would just store the text in a member variable which I could then access the actual value.
|
|
|
|
|
I have several DTS packages that each exports a table to a text file. The text files all have a common output folder which I would like to configure using a dynamic properties task.
However, all these packages are executed using another higher level package, and I would like to configure the output folder in this package. How do I communicate the setting to the lower level packages?
My blog.
|
|
|
|
|
I have a textbox (txtPCID), button (btnSearch), and datagrid (DataGrid).
Right now, I want to enter "P0002" in the textbox and click on the search button, I will get all the records which belong to PCID= P0002.
Look at that 4th line.
I don't know why the value in the textbox cannot pass to the sqlCommand?
How to solve it?
Sub BindDataGrid()
Dim Tpcid As String
Tpcid = txtPCID.Text
cmdSql = New SqlCommand("Select * From Peripheral WHERE PCID=' & Tpcid & ' ", myConnection)
myConnection.Open()
DataGrid.DataSource = cmdSql.ExecuteReader()
DataGrid.DataBind()
myConnection.Close()
End Sub
|
|
|
|