|
dgCDList->DataSource = core->databaseDataSet->CD;
core->oleDbCDData->Fill(core->databaseDataSet);
|
|
|
|
|
I need to set up a mail account for reporting services in SQL 2k
can anyone point me to some information
Thanks Paul
|
|
|
|
|
Hi all,
I would be most grateful of some help !!!!
I have a number of Text boxes (including a rich text box) and I simply want to insert the data into an access DB.
I have made a ADO.net connection, adapter and then it has generated a dataset (using GUI not code). I can display the data but just can’t find a good explanation of the statement needed to insert into DB
Any Help would be fantastic !!!!
Thanks
Martin
|
|
|
|
|
|
Hi,
Sorry to bother you but i am unfamiliar with C# and am still having big difficulty.
I need a very basic step by step help.
Would be most grateful
Thanks
Martin
|
|
|
|
|
C# uses the .NET framework, as does VB.NET. The API calls will be the same. Perhaps if you could break down exactly what you're finding hard - do you know anything about SQL to start with ? Do you know anything about how ADO.NET works ? Did you know how to bind a data source to a data grid, or did you copy the code from somewhere ?
If I have an idea of your skill level, and what bits you're struggling with, perhaps I can be more specific.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi,
I have no SQL experience !
I know the basics of ADO.NET i.e. create a connection adapter and dataset this can then be used to bind to datagrid, listbox ...
However i have no idea about how to work with connections.
Thanks for all your help !
Martin
|
|
|
|
|
Try this[^] as an intro into the overall code you need, and the SQL Insert page I linked you to before for info on the Insert statement generally. So long as you have a database already that expects the values you want to write, you should be fine. Make sure you're providing a value for each column in the row you're creating, unless a default value exists.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hye There
I have created one user in SQL Server and it has rights in two different databases at a time. Now I want to script the user. the option available is to script with in database by right clicking on the database then script. I want to scrip the user to get rights on all the databases togather.
Any Comments
|
|
|
|
|
|
Hi All,
When bound datagrid to some table, edit a cell in a row and press SAVE button(on my toolbar) to update it. it doesn't update the row being edited, until we focus on row below it or above it.
Regards,
sorry for my bad English.
|
|
|
|
|
hi, i have a code works with oracle sql i want to change the problem in it that doesn't work with sql2000 soplease any one help me
the sql statement is:
select folderindex, NAME, PARENTFOLDERINDEX from pdbfolder
connect by prior FOLDERINDEX=PARENTFOLDERINDEX
start with PARENTFOLDERINDEX = " + indexx + "
order by(PARENTFOLDERINDEX)
it gives me an error on line to when i test it on the sql 2000 query analyzer so what is the solution :->
Thanks alot
Mohammad Daba'an
|
|
|
|
|
Hi,
Anybody knows if it's better in an application to do a "for {}" statement and so segment, for example, 30000 results in 1500 parts (+ or - don't mind, it's the idea) to do an sql insert or doing a unique process witch treat all the results ??
for example
for (int myI = 0; myI < 30000; myI += 1500)
{
here storedprocedure in wich i take items between myI and myI +1500) and so use a portion of these items
...
SqlDataReader dr = MaCommande.ExecuteReader(CommandBehavior.CloseConnection);
(1500 items are read)
while ( dr.Read()) {process action}
}
or directy use all results classically (stored procedure without between)
...
SqlDataReader dr = MaCommande.ExecuteReader(CommandBehavior.CloseConnection);
(30000 items are read)
while ( dr.Read()) {process action}
Witch solution is better ?
Thanks for your reply
Christophe
Christophe
|
|
|
|
|
|
thank you very much Colin
Christophe
|
|
|
|
|
I am trying to access a database from a client and am getting access errors. I have it working on the server. The server is setup to trust the assembly via a strong key.
I don't want to setup each client to trust the assebly so I am trying to use SqlClientPermission.Assert but it does not seem to be working.
Any ideas? Thanks in advance.
Here is the code
SqlClientPermission sqlClientPerm = new SqlClientPermission(PermissionState.Unrestricted);
sqlClientPerm.Assert();
string strSql;
string myConnectString = "Persist Security Info=False;Integrated Security=true;database=myDataBase;server=xx.xxx.xxx.xx;Connect Timeout=10";
strSql = "UPDATE tblText SET Text = '";
strSql += tbText.Text;
strSql += "' WHERE TextID = 1";
// Set the query
SqlCommand sqlCmd = new SqlCommand(strSql);
// Get the connection
sqlCmd.Connection = new SqlConnection(myConnectString);
sqlCmd.CommandType = CommandType.Text;
// Open the database
if ( sqlCmd.Connection.State == ConnectionState.Closed )
{
sqlCmd.Connection.Open();
}
// Do the query
sqlCmd.ExecuteNonQuery();
SqlClientPermission.RevertAssert();
|
|
|
|
|
Hi,
I am working on VB.NET Windows form application. I am using Data Binding feature of .NET. I have one problem as described below:
There are two table call “Overheads” and “OverheadDistribution”.
OverheadID is Primary Key for Overheads and FK for Overheads.
There is a Master-Detail Win Form where OverheadDistribution is shown in Datagrid as part of Detail part for selected Master (Overhead).
When I fetch data from Data source in DataSet. I make a DataRelation using OverheadId and assign this DataRelation to Datagrid as DataSource.
There are ten numbers of records in OverheadDistribution and for OverheadID=1, there are two records (OverheadDistributionID = 3,5). So, there are two rows in Datagrid.
When I want to delete a row from Datagrid, I select a row in Datagrid, get Row index using CurrentRowIndex, let assume I select row no 2 means actually fifth row in datatable (“OverheadDistribution”).
So, How can I find corresponding row of Datagrid in Datatable? Means, by clicking on Datagrid row, how can I find respective row in DataTable?
Regards,
|
|
|
|
|
Hi there! Over the past few years I've worked on a number of websites. I've implemented a Search with varying conditions many times, but now it's different. So far the Search used stored procedures and dynamic SQL:
DECLARE @select_fields NVARCHAR(1024)
DECLARE @where_clause NVARCHAR(4000)
DECLARE @join_clause NVARCHAR(2048)
DECLARE @query NVARCHAR(4000)
SET @select_fields = '...'
SET @join_clause = ''
SET @where_clause = ' WHERE 1 = 1'
...
IF @in_field1 IS NOT NULL
SET @where_clause = @where_clause + ' AND [table1].[field1] = @in_field1'
IF @in_field2 IS NOT NULL
SET @where_clause = @where_clause + ' AND [table2].[field2] = @in_field2'
...
SET @query = 'SELECT' + @select_fields + ' FROM [table1] AS [t1]' + @join_clause + @where_clause
DECLARE @params_def NVARCHAR(1024)
SET @params_def = '@in_field1 TYPE, @in_field2 TYPE, ...'
EXEC sp_executesql @query, @params_def,
@in_field1 TYPE,
@in_field2,
... But now I'm facing an application that is requiring an advanced search with about 35-40 conditions, some of them arrays. I can't use the code above, because the @query variable is only 4000 characters long. As you can imagine, 35-40 conditions won't fit in it . What is the best way to implement this Search using stored procedures? I don't want to build the SQL code in the program code and pass it to the stored procedure. Thank you. Stanimir.
|
|
|
|
|
What if you passed the conditions in as an XML document, used that to build a table and then did your query against the values in the table ( which would have one row ) ? I believe you can pass in a text field greater than 4000 chars ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi Christian!
Thank you for your reply. The solution is great, but can you give me an example where the search is performed against UNIQUEIDENTIFIERs, INTs, BITs, NVARCHARs (using LIKE ? How should I build the table from an XML document? How should I match the real table with the temporary one?
Thank you.
Stanimir.
|
|
|
|
|
LIKE only works for strings.
This link is one of many I found on OpenXML, which is built into SQL Server 2000, and lets you build a table from an XML document.
http://www.sql-server-performance.com/jb_openxml.asp[^]
Note - if you use OpenXML, you need to have a recent version of IE installed, to get the required XML DOM support. Fun and games.
Stanimir Angeloff wrote:
How should I match the real table with the temporary one?
Just join to it, or match against it's properties. Use select TOP 1 to remind SQL Server that you're selecting a single value ( there is only one row to start with ).
Hopefully that's enough to get you started, let me know if you're stuck. OpenXML is IMO the best way to pass a variable number of parameters to SQL Server, for example if you need to delete an unknown number of rows, or in a situation like this.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi Christian!
Thank you for your quick reply. The information is very useful. It's just what I was looking for. I've solved my problem using only one NTEXT parameter (where the XML document is passed).
Thank you.
Stanimir.
|
|
|
|
|
Glad to help. I know that OpenXML rocked my world when I found out about it. It makes a lot of stuff that seems hard suddenly very simple.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
OpenXML is integrated in sql 2000 or not ? If yes why do i need new ie version?
sorry for asking i`m new in this
|
|
|
|
|
OpenXML is integrated, but the XML DOM implimentation it uses is not. Believe me, I was pretty amazed myself when the one part of my app that uses OpenXML started crashing on W2000
Christian Graus - Microsoft MVP - C++
|
|
|
|