|
Thanat0s4 wrote: Is this suppose to be right ?
Nope.
You have specified a variable name inside a string and somehow expect the system to expand that out into the contents of the variable. That isn't going to happen because it doesn't know that's what you want to do. It has just been told to assign a string to a value. Nothing more.
string connString = @"
server = .\sqlexpress;
integrated security = true;
database = "+inputs[0]+";
MultipleActiveResultSets = true;
";
|
|
|
|
|
I have lots of files and for each file I will have a lot of strings that I have to save, about 1000000 strings. I want somehow to be able to save the information of each file. To be able to search for a string in the table, and to get the information of the row. The problem is that I am afraid that it will have problems making queries on very large tables. The number of records in this table can arrive easyly to 100 million. Is there anyway, to configure SQLServer to handle large tables or any other way. Any suggestion could be great since I don't have too much experience with the abilities of SQL Server.
Thanks,
Clint
|
|
|
|
|
SQL Server can easily handle hundreds of millions of rows in one table. I have a table here with 25 million rows in it. The key to SQL Server performance is in ensuring that you have suitable indexes on the tables and ensuring that you write your queries in such a way that the indexes get used.
|
|
|
|
|
I've got a stored procedure that calls other stored procedures so that I end up with 8 sets of results when it is run. I'm trying to figure out how to get all 8 of those result sets into one dataset, and 8 seperate datatables within the dataset. I've got code that does run the sp and I'm attempting to put the results into seperate tables in the dataset, but I end up with the same results in all 8 datatables. Here's my code (just trying to get first four results here to test):
The code from my data class:
public static DataSet getDataSet(string xref)<br />
{<br />
SqlConnection con = new SqlConnection(getConnectionString());<br />
<br />
try<br />
{<br />
SqlCommand kpfCmd = new SqlCommand(kpfSP, con);<br />
kpfCmd.CommandType = CommandType.StoredProcedure;<br />
<br />
SqlParameter paramXREF = kpfCmd.Parameters.Add("@XREF", SqlDbType.Int);<br />
paramXREF.Direction = ParameterDirection.Input;<br />
paramXREF.Value = xref;<br />
<br />
SqlParameter paramIP = kpfCmd.Parameters.Add("@ADDR", SqlDbType.VarChar);<br />
paramIP.Direction = ParameterDirection.Input;<br />
paramIP.Value = null;<br />
<br />
SqlParameter paramNetname = kpfCmd.Parameters.Add("@NetName", SqlDbType.VarChar);<br />
paramNetname.Direction = ParameterDirection.Input;<br />
paramNetname.Value = "eappell";<br />
<br />
SqlDataAdapter ad = new SqlDataAdapter(kpfCmd);<br />
DataSet ds = new DataSet();<br />
<br />
ad.Fill(ds, "Auth");<br />
ad.Fill(ds, "Results2");<br />
ad.Fill(ds, "Results3");<br />
ad.Fill(ds, "Results4");<br />
return ds;<br />
}<br />
finally<br />
{<br />
con.Close();<br />
}<br />
}<br />
Here's my code-behind for the page:
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
DataSet ds = KPFData.getDataSet("602");<br />
GridView1.DataSource = ds.Tables["Results2"];<br />
GridView1.DataBind();<br />
<br />
GridView2.DataSource = ds.Tables["Results3"];<br />
GridView2.DataBind();<br />
<br />
GridView3.DataSource = ds.Tables["Results4"];<br />
GridView3.DataBind();<br />
}<br />
I've been working on this for a few days, and have posted messages on a couple other message boards but no one seems to know the answer to this one. I'm really hoping code project users are the key... Please help!
Thanks,
eddie
|
|
|
|
|
from the help:
If the DataAdapter encounters multiple result sets, it creates multiple tables in the DataSet.
The tables are given an incremental default name of TableN, starting with "Table" for Table0.
If a table name is passed as an argument to the Fill method,
the tables are given an incremental default name of TableNameN, starting with "TableName" for TableName0.
It would seem to me that you only need one ad.Fill call, say ad.Fill(ds,"Results");
Then bind to the tables like so:
GridView1.DataSource = ds.Tables["Results"];<br />
GridView1.DataBind();<br />
<br />
GridView2.DataSource = ds.Tables["Results1"];<br />
GridView2.DataBind();<br />
<br />
GridView3.DataSource = ds.Tables["Results2"];<br />
GridView3.DataBind();
|
|
|
|
|
i have created .rdl file programmaticaly in c#.
and i want to upload the rdl file to the location in report server progrmatically so that the report automatically reflects. hence i dont need to upload the rdl manually. has any one tried this?
below details i Need:
1.how this rdl file saved in report server?
2.how i have to save the rdl file programmatically?
|
|
|
|
|
Hello friends..
Is there any other alternative to start SqlServer..I have MS Sql Server 2000 installed on a XP machine. I downloaded it from someone's cd..now it says the time is expired..is there anyway to make it work once again..
|
|
|
|
|
You installed from a trial CD. The trial has expired, so you will need to install a licensed version. One option may be to uninstall what is there now (databases you have created will be left behind), then install MSDE 2000 which is available free (seethis[^] )
then attach your existing databases to the new MSDE server.
|
|
|
|
|
Forget MSDE. Go with SQL Server 2005 Exress. You'll be saving yourself a whole bunch of grief down the road if you go with SQL Server 2005 Express now.
http://msdn.microsoft.com/sql/express/default.aspx[^]
Jerry
"I'm happier than a tornado in a trailer park"--Cars
|
|
|
|
|
Hi Frends
I am trying to write a trigger ....whenever a particular column updates in my table then this record i.e. updated should be inserted in another table.
but problem is that its inserting all the records in IInd table whenever i update the record in first table.
My trigger is......
CREATE TRIGGER CreateTrans ON [dbo].[Table1]
FOR UPDATE
AS
IF (COLUMNS_UPDATED() & 49)=49
BEGIN
INSERT INTO [Table2](x.ID)
SELECT ID FROM Table1 x
END
GO
Thanks
Dinesh Sharma
-- modified at 5:25 Wednesday 26th July, 2006
|
|
|
|
|
You don't have any join to the "updated" record.
Try something like:-
CREATE TRIGGER CreateTrans ON [dbo].[Table1]
FOR UPDATE
AS
IF (COLUMNS_UPDATED() & 49)=49
BEGIN
INSERT INTO [Table2](x.ID)
SELECT x.ID FROM Table1 x INNER JOIN INSERTED ON x.Id = INSERTED.Id
END
GO
|
|
|
|
|
Give me a link from which i can able to access the all SQL commands and concepts
divya
|
|
|
|
|
this is a cool link to transact sql:
http://manuals.sybase.com/onlinebooks/group-as/asg1250e/sqlug/
Human knowlege belongs to the world
|
|
|
|
|
|
Very Effective Link
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
|
Hello,
I've been lurking for a while, but this is my first post. I've tried searching the forum, but either I'm not doing the search correctly or what I want just isn't there!
I am starting a new job soon, and it has been suggested that I take an online SQL (the query language, not SQL Server) class. Do you have any recommended (and preferably cheap!) vendors? I would need a beginner level class.
Thanks!
Nancy K
|
|
|
|
|
You might want to join the Association for Computing Machinery (www.acm.org). As a member (membership is about $100 USD) you have access to an extensive online course offering (as well as a large online library of books). They have a number of courses on databases. There are a handful of SQL courses, these are all part of a larger dataase curriculum that is targeted towards SQL Server, Oracle, or DB2, but the introductory courses are query language focused. See http://pd.acm.org/[^]
You also might want to check out http://sqlzoo.net/[^]
|
|
|
|
|
And then make a sample application from a db book that relies on SQL. (Best way to learn)
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
I'm researching encrypting certain fields in a SQL Server 2005 database. I'm interfacing with the db through a web application of my creation. I was reading through an article about DB encryption( http://blogs.technet.com/keithcombs/archive/2005/11/24/415079.aspx[^] ), and though I was able to get an experiment up and working, there were a few things I didn't understand.
Why is it such a bad idea to give a low level user access to the decrypted data, but not the certificates and keys? The person in the article created a view as an intermediary step so that the low level user can see the decrypted data, but not let that user use the certificates or keys. Why can't they just use the key to get the data manually? It's my understanding that you would have 1 key per encrypted field. Or am I wrong about that? Does 1 key and certificate cover the whole database?
In addition, if you don't want to give the low level user access to the encryption methods, what is a good way to let them encrypt something and add it to the database? I can't seem think of a method analagous to the view method demonstrated in the article.
|
|
|
|
|
Wow I COMPLETELY worded that wrong.
First sentence of the second paragraph should read: Why is it such a bad idea to give a low level user access to the certificates and keys? Why do they only have access to the data?
|
|
|
|
|
Providing users with keys is often unnecessary and can be hidden from them. Also, access to cryptographic keys can expose the data. It is best to only give a user only as much as required to perform the specific task in an effort limit overall system liability.
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
Hi,
Is there any function in SQL server 2005 which takes the date/time and time zone as the parameters and returns whether the given date/time follows the daylight savings or not.
I was looking to a function in SQL Server very similar to the WIN API GetTimeZoneInformation().
So the input: date/time, time zone
Output: true/false (follows daylight savings/does not follow)
Pls let me know.
Thanks.
|
|
|
|
|
B"H
I have an application that needs to add fields to a table based on runtime values.
On the other hand the data set has 3 other tables that would greatly benifit from strong typed design time schema.
I would like to be able to save and load the data to/from XML. Hopefuly in the same file.
the problem is that when I load a file that was generated from a modified DataSet into a strongly typed data set, the additional fields are not loaded.
Thank you.
Rabbi Moshe Plotkin
SUNY New Paltz
Chabad & Dept. Computer Science
|
|
|
|
|
I am trying to install VS MSDE however when I click on setup.exe it tells me "A strong SA pasword is required for security reason. Please use SAPWD switch to supply same....."
However must articale that I read provide a command prompt option to change the SA password using osql. However when I try to run that command I recieve and error message stating that "OSQL is not a recognized internal or exteranl command...." My question are: I can not recall installing or configure SA account on my system, hence I am not sure how to access the database to update the A account. 2nd - How can I configure my PC to Osql. I have added it as a path on my PC but to no avail. Any other suggestion will be greatly appreciated.
Greg
Coding makes the world go round!!!
|
|
|
|