|
Don't store files in the database if not absolutely required. It will put a large load on the database server and the network. If it is a web app, it can also tie up valuable threads for extended periods and cause delays for users.
If you must do it, store the file in text, ntext, or image field types. To store the file use a TEXTPTR and the UPDATETEXT commands. If you google on these, you will find some examples.
|
|
|
|
|
of course ! i added a textbox in my application and user can input some text in english like : The message you are replying to , then i split the textbox values into the array and search each word and fill in datagrid but the datagrid show me database where it store . for example like this
1. are
2. the
3. to
4. message
5. replying
6. you
|
|
|
|
|
Hello!
I would like some help with the following:
I want to get one (1) result out of two columns. I have for example "user1" and "user2". I would like to have "user1" as the result if "user2" contains the word "flintstone" and I would like to have "user2" as the result if "user1" contains the word "flintstone". I would like either of these to merge into a common name such as "user" or something, that I can use further with ASP.NET DataRepeater. Hope you understand, I have a sketch as well:
SELECT user1 FROM table WHERE user2='flintstone' --\
>-- user
SELECT user2 FROM table WHERE user1='flintstone' --/
Thank you!
|
|
|
|
|
Hi,
I am not clear with ur Query but just try this............
SELECT user1 User FROM table WHERE user2='flintstone'
UNION
SELECT user2 FROM table WHERE user1='flintstone'
I hope this will help u.............:->
Regards,
Ritesh
|
|
|
|
|
:-Dhai,
iam connecting the ado.net through a wizard or server explorer or manually using adapter. it is connecting in the dataset but iam getting error as given below:
An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll
Additional information: System error.
can anyone help me to solve this problem
Even i need a manual source code connectivity of ado.net
Success in Career
|
|
|
|
|
Hi,
Try this code.........
<code> Private Sub PullData()
'DECLARE VARIABLES
Dim ds As New DataSet("DataSetName")
Dim dr As DataRow
Dim myConnection As New SqlClient.SqlConnection("Data Source={Local};database=Northwind;user id=sa;")
Dim myAdapter As New SqlClient.SqlDataAdapter()
Dim myCommand As New SqlClient.SqlCommand(("SELECT LastName, FirstName, Title, BirthDate FROM Employees"), myConnection)
Try
myCommand.CommandType = CommandType.Text
myAdapter.SelectCommand = myCommand
myAdapter.SelectCommand.Connection = myConnection
myAdapter.Fill(ds,"Employee")
Catch ex As Exception
lblMessage.Text = ex.Message
End Try
'Close connection
myConnection.Close()
dataGrid.DataSource = ds.Tables("Employee")
End Sub</code>
I hope this will help u.............:->
Regards,
Ritesh
|
|
|
|
|
Hi for my application I need to connect to a remote SqlServer, I just wanted to know that in the following connection object
string conn =
"Data Source=xxx.xxx.xxx.xxx,1433;" +
"Network Library=DBMSSOCN;" +
"Initial Catalog=ABC;" +
"User ID=ABCUser;" +
"Password=xxxxxxxxxxxx";
can I replace IP Address xxx.xxx.xxx.xxx to URL Name such as www.anysite.com
is it allowed, and if allowed how does conversion from URL to IP address is done.
RuchirDhar Dwivedi
Software Engineer
Windowmaker Software Pvt.Ltd.
Baroda, India.
|
|
|
|
|
Hallo,
I just posted this message in C#-section, but I saw the ADO.NET section and I think its better to post it here... sorry for doubleposting...
I'm a real beginner with C# and I have a silly problem with one DataTable combined with a DataGrid.
Short describing of surround:
I have one DataSet with three DataTables, each shown in DataGrids.
The DataSet is persistent (typed DataSet) as .xsd-file.
DataBase ist MSDE. All three DataTables are filled with the
DataAdapter.(DataSet, DataTable).Fill-Method.
If I execute the fill-Methode for one table twice or more, in my datagrid the records are added. To avoid this behaviour, I want to use the
DataSet.Tables["table"].Clear()-Method
before executing the Fill-Method. With two DataTables it works, but with the third, the DataGrid stays empty after the Fill-Method.
- in the debugger I can see that there are records in the DataTable
- when I click into the DataGrid, an error occurs that I try to translate (German version):
"DataBinding could not find line in list that can be used vor all bindings."
Help would be very appreciated.
Thanks
Vexta
|
|
|
|
|
If i have 2 table, table1 and table2, and joining them in a view, should I first select all fields from table1 and then fields from table2, or I can select in random order from both tables? Is there any performance issue, if selecting in random order? Thanks.
<italic>Work hard, Work effectively and a bit of luck is the key to success.
|
|
|
|
|
|
Hi, I have exported as a script my db from one server and i want to run the script in the other server in order to create the db that i had in my first server Can somebody tell me how to do that?
La Light
|
|
|
|
|
Inside SQL Enterprise select the database.
/All Tasks/Generate SQL Script
Press Show All and you in businees.
Hope this helps
Al
|
|
|
|
|
Hi All,
I need to assign ranks to the people according to their scores (within each exam).
Id ExamCode Total
1 C1 100
1 C2 98
2 C1 100
2 C2 97
3 C1 89
3 C2 99
how can i accomplish this..
Can anyone help me
Thanks in advance,
|
|
|
|
|
Here's a code from MSDN, might help you. Case[^]
USE pubs<br />
GO<br />
SELECT 'Price Category' = <br />
CASE <br />
WHEN price IS NULL THEN 'Not yet priced'<br />
WHEN price < 10 THEN 'Very Reasonable Title'<br />
WHEN price >= 10 and price < 20 THEN 'Coffee Table Title'<br />
ELSE 'Expensive book!'<br />
END,<br />
CAST(title AS varchar(20)) AS 'Shortened Title'<br />
FROM titles<br />
ORDER BY price<br />
GO
<italic>Work hard, Work effectively and a bit of luck is the key to success.
|
|
|
|
|
strsql = " select * from dic where english='" & SearchBox.Text Or TextBox4.Text & "'"
The machine said Input string was not in a correct format.
How can i select database with or operator in asp.net .
Is it possible to select database in sql from more textbox ?
ere ewrewrwe werewrewr
|
|
|
|
|
bibipopopopo wrote:
strsql = " select * from dic where english='" & SearchBox.Text Or TextBox4.Text & "'"
It is certainly possible to build a dynamic SQL query like the one you are referring, but I think you have just got your string formation messed up.
Assuming that SearchBox and TextBox4 are VB textboxes containing some textual criteria, then try:
<br />
strsql = "SELECT * FROM dic WHERE english='" & SearchBox.Text & "' OR '" & TextBox4.Text & "'"<br />
Notice the ' in the string separators.
This would form a valid statement e.g.
SELECT * FROM dic WHERE english='AMERICAN' OR 'CANADIAN'
I Dream of Absolute Zero
|
|
|
|
|
|
|
Hi All,
I need to assign ranks to the people according to their scores (within each exam).
Can Anyone help me...
Thanks in advance,
|
|
|
|
|
|
I want to pull data from a table using a regular SQL statement for my adapter (using WHERE and ORDER BY - this I can do fine) but I want to use values from another table as criteria for my WHERE statements... how do I do this?
Basic Sample would be nice.
Thanks
|
|
|
|
|
There are many ways. Can you give an example of what you are trying to do? Do you just want to use the value from one row in the other table as the criteria? (Simply extracting the data into variables then using in a where might be sufficient in this case) Do you want to use data from many rows as the criteria? (In which case some sort of table join would be best)
My: Blog | Photos | Next SQL Presentation
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
Lets say Table1 has:
ID, Num1, Num2, Num3, FullName, ItemName, ItemColor, ItemValue, ItemWeight
Table2 has:
ID, Ber1, Ber2, Ber3
To sort Table1 generically I would use:
SELECT ID, Num1, Num2, Num3, FullName, ItemName, ItemColor, ItemValue, ItemWeight FROM Table1 WHERE ItemValue>100 ORDER BY Num1, Num2, Num3, ItemWeight
I would like to use Table2’s values from columns Ber1, Ber2, and Ber3 as criteria to sort by for Table1’s Num1, Num2, and Num3’s values.
Just the values from a single row for now would be helpful (Columns Ber1, Ber2, and Ber3).
This is used for configuring the Adapter for the connection.
By the way, the two tables aren't related.
The columns (Num1, Num2, Num3 and Ber1, Ber2, Ber3) do have the same Look-Up Tables. I just have Table2 as a criteria to sort Table1 by.
Looking into JOINS.
Thanks
|
|
|
|
|
Thanks Colin,
I ended up using an INNER JOIN similar to what follows:
SELECT * FROM Table1 INNER JOIN Table2 ON Table1.Num1 = Table2.Ber1 AND Table1.Num2 = Table2.Ber2 AND Table1.Num3 = Table2.Ber3 WHERE ItemValue > 100 ORDER BY ItemWeight, AndAnythingElse
This was the easiest, just didn't know what was best.
|
|
|
|
|
Anybody know if the COALESCE(NULLIF ...)...) can raise error itself, and if
it safely to use this combination of checking error status
Every time after i calling to some store procedure i use this:
------------------------------------------
DECLARE @intError int
EXEC @intError = myProcedure @param1, @param2 .....
SELECT @intError = COALESCE(NULLIF(@intError, 0), @@ERROR)
IF(@intError =0 )
......
......
--------------------------------------------
my question is, can the @@ERROR variable have an error that COALESCE or
NULLIF function were raise?
Thanks.
P.S. if it's not good idea to use it after calling to stored procedures so
what can u advice me
------------------------------------
To study, study and only to study
|
|
|
|
|