|
1. No. SQL server exress 2005 is a newer version of SQL server (Yukon - not yet released) than the MSDE distributed with VS. Net 2003 (SQL 2000). Most SQL 2000 functions should work the same on Yukon (It is backwards compatible), but there is no gaurantee at this point since it is not released.
2. No it will not work like Access, you will need to install the server if it is not already present, and attach or create your database to the server.
Why would anyone waste time arguing with an accountant about anything? Their sole function is to record what happenned, and any higher aspirations are mere delusions of grandeur. On the ladder of productive contributions they are the little rubber pads at the bottom that keep the thing from sliding out from under you. - Roger Wright
|
|
|
|
|
I'm new to .NET and C# coming from VisualFox background.
I'm having a tough time with this control, namely determining which row has been selected.
I have four columns, three of which are visible, the fourth contains an id which becomes the parameter to a Stored Procedure which then populates a DataGrid.
e.g.
private void listView2_SelectedIndexChanged(object sender, System.EventArgs e)
{
cmdSelectZoneCosts.Parameters["@zoneid"].Value=this.listView2.SelectedItems[0].SubItems[3].Text;
dsZoneCosts.Clear();
daZoneCosts.Fill(dsZoneCosts, "ZoneCosts");
}
For some reason, the code is executed TWICE(?) the first time the .SelectItems.Count = 0 which crashes the line. If I "trap" for that i.e.
if (this.listView2.SelectedItems.Count !=0)
{
cmdSelectZoneCosts.Parameters["@zoneid"].Value=this.listView2.SelectedItems[0].SubItems[3].Text;
dsZoneCosts.Clear();
daZoneCosts.Fill(dsZoneCosts, "ZoneCosts");
}
It works this way, but why is it running the code twice ??
Can anyone point me in the right direction to a sample walkthrough of a simple form which will display records from a database, Add, Edit, Delete functions.
Roger
|
|
|
|
|
Can any one help me with the following SQL statement. I am getting a syntax error. I am trying to update fields in a access database. Thanks
strSQL = "UPDATE tblSetup SET"
strSQL = strSQL & "tblSetup.Company_Name = '" & txtName & "',"
strSQL = strSQL & "WHERE tblSetup.Company_ID = '" & txtID & "'"
|
|
|
|
|
|
Thanks. I will try it out.
|
|
|
|
|
I`m new to ADO.NET, can we update a table from the datagrid? Thanks
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
You can update the database from the datagrid it is possible in web.ui.datagrid.u must use the templates of datagrid properties
e.veera raghavendra
|
|
|
|
|
How Can I Generating wrapper code for SQL Server Stored Procedure ??
If You will Go To The Following link you will see an example for Generating wrapper code for Oracle Database .. And Also the author say there is built in tool for Generating wrapper code for SQL Server
http://www.codeproject.com/vb/net/OracleSPWrapper.asp
my question .. where is this tools ???
and thanks with my regarding
Fraas
|
|
|
|
|
I want to practice my SQL on Excel spreadsheets. When I have a project open in VS2003.NET and open the 'Server Explorer' window, it tells me (as it should) that there are no SQL Servers to connect to.
When I was learning SQL in school we would connect to the Oracle 9 Database on the Network. Now I want to continue practicing SQL/C#, but have no network/database or internet connectivity.
Is there a way I can add an add an "SQL Server" to this path when in fact the "Server" is located on the same laptop.
Please forgive my ignorance on the subject. I'm in no way pretending to know what I'm talking about but very much want to learn...
thanks for your time....
|
|
|
|
|
Hello,
I want to use the command Server.MapPath and need the Server object. Where I can found it for reference ?
|
|
|
|
|
The Server property is an intrinsic object accessible from within ASP.NET. You cannot simply use Server.MapPath (which is actually HttpServerUtility.MapPath ) because 1) it's an instance method and you cannot instantiate the HttpServerUtility class yourself, and 2) it only works with a given virtual path because it needs to map a virtual path to a physical path. This is specific to both the virtual host and the virtual directory. Even on two different virtual hosts, a virtual directory will map differently to the same physical directory.
For future reference, if you have a question about what assembly a class (not object, which is an instance of a class) is defined in, you can view the bottom of the class documentation topic in the .NET Framework SDK that states what namespace and in what assembly the class (or any Type) is defined.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hello, thx for response. Yes I am working on an ASP.NET project and need the MapPath Method. But if I cannot instantiate it, i have no possibilities accessing it ?
|
|
|
|
|
|
I have read it, but still not the correct hint.
This is what I've looked for :
HttpContext.Current.Server.MapPath
Because I didn't found the Server object, I thought I need an explicit IIS dll. But now I found this in the web by chance ( all other places show System.MapPath instead the right ASP.NET Version ).
|
|
|
|
|
You can also access the Server property from the Page class (or rather the instance of the Page for your code, if you're running within a .aspx for example).
Excuse me for wondering why you're trying to access the Server property when you posted in the ADO/ADO.NET forum. Next time please use the appropriate forum, i.e. the ASP.NET forum.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Excuse me for wondering why you're trying to access the Server property when you posted in the ADO/ADO.NET forum. Next time please use the appropriate forum, i.e. the ASP.NET forum.
Because I am developing a DB Application, where I need this in the connectionstring.
|
|
|
|
|
It's still a question about ASP.NET. If you had a question about how to do a particular operation in C# you'd ask in the C# forum. The context of the application isn't as important as the context of the question. We don't know what you're writing, but if you ask in the right forum you'll get a more appropriate response.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hi, I have a little problem with data bounding a listbox, it works just fine when I bound the listbox to a “parent -> child” structure but when I want to bound it to the following structure I just can’t get it to work.
product (table)
- prod_id (PK)
- prod_name
category (table)
- cat_id (PK)
- cat_name
product_category_relation (table)
- prod_id (PK)
- cat_id (PK)
product (one to many) -> product_category_relation <- (one-to-many) category
I want to get the category names into a listbox when a product is chosen through data bounding, any help in the right direction is much appreciated, thanks in advance.
|
|
|
|
|
I have just recently created a few reports for this web app we are working on. Upon constructing the reports and connecting them to some stored procedures i noticed that the parameters passed to the report only allow a single selection for a specific parameter.. for example if you have an employee parameter it only allows a single selection which sucks if you want the user to be able to pick a few employees.
i was wondering if anyone had information on creating or modifying the current reporting Service Api that renders reports so that one could create custom parameter selection tools.
here is an example of what im looking for.
http://dspace.dial.pipex.com/town/drive/xxg48/CustomParameters.html
any information would be great!
|
|
|
|
|
Hi there,
Who can help me with this one.
I have a form with a Checkbox treeview. Now the user select one or more items.
I want execute a procedure which gets all the items selected in the treeview.
I tryed a procedure similar like the example
CREATE PROCEDURE dbo.GET_InstrumentReport @SELECTED varchar(2000) AS
SELECT *
FROM tblKBRLIJST
WHERE (tblKBRLIJST.ID = @SELECTED) AND (tblKBRLIJST.Valid = 1)
GO
The Parameter @SELECTED conains the value's like '44&67&89'
When Execute this only the first one is returned.
any solution ?
Thanks.
|
|
|
|
|
Your query string should look like:
SELECT *
FROM tblKBRLIJST
WHERE tblKBRLIJST.ID IN (44,67,89) AND tblKBRLIJST.Valid = 1
Your problem is how to form (44,67,89) from a parameter. The easy way would be to use sp_executesql
CREATE PROCEDURE dbo.GET_InstrumentReport
(
@Selected NVARCHAR(2000)
)
AS
DECLARE @sql NVARCHAR(2000)
SET @sql = N'SELECT * FROM tblKBRLIJST WHERE tblKBRLIJST.ID IN (' +
REPLACE(@Selected,'&',',') +
N') AND tblKBRLIJST.Valid = 1'
EXEC executesql @sql
You can't use the parameter directly because it mixes values with SQL syntax. SQL syntax will be ignored if it is used as a parameter. Therefore, you must build the entire string by hand and pass it as a string.
Note: You should add some protection for SQL injection in the above code.
|
|
|
|
|
|
Thanks for the quick response,
I consider both solutions.
The solution from Michael Potter is nice as long I do not pass a to big amount of
parameters (the variable is limited to a max of 8000 bytes)
but as long it is less (for me its meaning that I can max lookup approx 50 records)
then it works fine for me.
But.
The last one takes some more programming but there isn't a limit on the max
records to select.
Do you use a real table or a table what is only in memory ?
If you use a real table do you use a table for each user or running procedure ?
The currently App I am writing does not have sensitive data so I am not worry about the
SQL Attack injection
So I think that I use the first solution for now and work the second solution out
when I planned to make a updated release.
|
|
|
|
|
RDoes wrote:
Do you use a real table or a table what is only in memory ?
I use a temporary table. i.e. When you create it you prefix the table name with a # and SQL Server puts it in the tempdb. At the end of the stored procedure it automatically drops the table for you.
RDoes wrote:
If you use a real table do you use a table for each user or running procedure ?
All tables are real. But the table is very short lived. You can create a large table if you want (e.g. if you are going to pass the same values several times then there is no point in recreating a table each time)
RDoes wrote:
but as long it is less (for me its meaning that I can max lookup approx 50 records)
then it works fine for me.
If you need more than 50 records (assuming that is the max you can do with an 8000 char parameter can handle) then you probably want to populate the table outside the stored procedure. In which case you may with to have a permanent table and add an extra column to prevent clashes between various users running procedures with the table at the same time.
RDoes wrote:
The currently App I am writing does not have sensitive data so I am not worry about the
SQL Attack injection
If I told you that through a SQL Injection attack it is possible to attack more than just SQL Server would you reconsider? For example I could use a SQL Injection attack to format the disk, or break out in to other parts of the operating system. It is even possible to compromise machines remote to the SQL Server if they are all within a trusted network.
Do you want to know more?
WDevs.com - Member's Software Directories, Blogs, FTP, Mail and Forums
|
|
|
|
|
Colin Angus Mackay wrote:
I use a temporary table. i.e. When you create it you prefix the table name with a # and SQL Server puts it in the tempdb. At the end of the stored procedure it automatically drops the table for you.
Hmm Thats nice it is good to now that
I think I going to use a static table so that when the user is selecting a node in the tree view it can be directly added in the table (with a GUID for that session to keep the users separated.)
Colin Angus Mackay wrote:
If I told you that through a SQL Injection attack it is possible to attack more than just SQL Server would you reconsider? For example I could use a SQL Injection attack to format the disk, or break out in to other parts of the operating system. It is even possible to compromise machines remote to the SQL Server if they are all within a trusted network.
Good point, I don’t now it can be done. How is that generally working?
Do I have that problem only when I use the Exec() method or also with other functions or methods
like WHERE for example (WHERE ID = @ID).
|
|
|
|