Tagged Questions
14
votes
3answers
4k views
“Server” vs “Data Source” in connection string
I'm new to SqlServer, right now I have SqlLocalDb installed to work locally. Good, but I can see two connection strings typically and both works:
Data Source=(localdb)\v11.0;Integrated Security=true;
...
3
votes
2answers
3k views
SQL Data Source - store procedure and return parameter
I have a store procedure in SQL Server which returns a value:
CREATE PROCEDURE [dbo].[insertProc]
@value1 INT,
@value2 INT
AS
BEGIN
SET NOCOUNT ON;
INSERT INTO table1(value1,value2) ...
2
votes
2answers
534 views
using different data connection in visual studio
It's possible to use 2 or more data connections in visual studio and using them in a single query, like we can do in sql server management (while we use mysql and mssql dbms same time):
SELECT * INTO ...
2
votes
3answers
447 views
SqlDataSource won't retrieve logged in user's data from database?
I tried retrieving the user's data based on the logged in UserId, but no progress. Any suggestions?
protected void SqlDataSource1_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
{
// ...
2
votes
1answer
3k views
How can I do a cast in a SqlDataSource FilterExpression?
I'm using a single textbox to search a report and filter out records. One of my fields is an int32 and the rest are varchar's. So when the filter tries to compare the string from the textbox with the ...
2
votes
1answer
680 views
a large paged GridView, Rollup and Grand Totals with SQLdataSource
If I get my dataset into a DataTable then I can do with it as I like, but I have the complexity of handling sort, paging and caching manually. I'm trying to avoid this for now.
If I instead use a ...
1
vote
5answers
279 views
Delete file when deleting row from table
On my website I use simple file management. User can upload files, see the list and delete them. In database I have one table Files which contain information about files (file name, description, ...
1
vote
4answers
2k views
Tips on speeding up a SqlDataSource?
I have two SqlDataSource controls on a page. One loads high level data and the other loads more details based on which high level item you choose. It is a part of a large search that has over ...
1
vote
2answers
2k views
How to convert asp.net NULL value to “” (blank string)
I have a situation where I am using a detailsview with the SQLDataSource to update a record in an SQL Server Database.
My issue is that textfields that are not completed are converted to NULL in the ...
1
vote
3answers
172 views
Static WHERE clause in SQLDatasource
I need to execute the query according to the Businessunit values which is to be passed in runtime. If the businessunit is null the AND condition should not get executed and if it is not null i have to ...
1
vote
2answers
1k views
How to Extract data from a SQLDataSource to a datatable
Is it possible to store data that is retrieved by SqlDataSource in a DataTable? I mean, If I dragged and dropped a GridView and an SqlDataSource and then I set up those controls in page designer in ...
1
vote
2answers
273 views
Cascading One DropdownList with Another in Insert command on asp
I have this asp in a formview insert template.
<asp:FormView ID="FormViewReport" runat="server">
<InsertItemTemplate>
GAME_ID:
<asp:DropDownList ...
1
vote
2answers
608 views
SqlDataSource Parameter Problem - Using loginName1 as sql parameter
I am trying to retrieve database info that is specific to currently logged-in user.
The following 3 lines let me know that var1 is correct (As it displays it on the page)
Dim var1 As ...
1
vote
2answers
1k views
Accessing the result set of a stored procedure, executed using SqlDataSource.Select
I'm programming a webpage in ASP.NET which displays a list of students not listed as participants in something, and upon clicking a student name shows you a brief summary of their details, so the user ...
1
vote
1answer
674 views
How to debug SqlDataSource
I'm testing my site against SQL injection attacks and I would like to trace SqlDataSource messages sent to SQL server. How can I do that or at least get as close as I can.
1
vote
1answer
165 views
Can you only use one Select command w/SqlDataSource
This is a pretty simple question that I haven't been able to find an answer for. Is it possible to have two separate SELECT commands (from the same table) in the same SqlDataSource command to populate ...
1
vote
0answers
204 views
How to filter using a dropdown in a gridview and display all values when none is selected
I have a web page with 3 values (1 text box, and 2 drop-downs) and displays result in a gridview. This is working great when the value that I want to search is in the drop-down. However, if the user ...
1
vote
0answers
155 views
How to make SQLDataSource insert into view instead of the underlying table?
We have replaced 20 tables with a consolidated table, that separates each set of data via a "set id" (all the records for table "A" have a set_id of 1, table "B" is 2, etc.).
We then built views on ...
1
vote
0answers
397 views
how to use a procedure with Default parameter in gridview ASP.NET VS in sqldatasource
I want to use a stored procedure that can make some parameters with null value and then test it if the parameter is null or not and do some coding , the procedure is working fine ... but when i want ...
0
votes
3answers
6k views
Running a stored procedure in a SqlDataSource on button click
I am building a C# ASP.NET page where I want to call a stored procedure in a database.
I have setup a SqlDataSource which points to the stored procedure. Parameters are obtained from the Web's ...
0
votes
2answers
58 views
SQL Join query in SqlDataSource
I am not really sure about how to do this.
In a table Product1 I have:
Id, Code, Description, Group, Quantity, Unit, Cost, Note
In the other table Componets I have:
Id, Code, Description, Unit, ...
0
votes
2answers
3k views
Asp.Net CheckBoxList to update a SqlDataSource
I need to update some table values using Checkboxes. The table consist of 3 simple columns: id, name and selected (bool).
I added a asp:CheckBoxList control to a form, bound it to a SqlDataSource.
I ...
0
votes
3answers
949 views
Giving alias in JOIN command in sqldatasource
I am using JOIN command to connect two tables in SqlDataSource.
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:CS %>"
...
0
votes
3answers
480 views
Declare table variable in sqldatasource (aspnet)
I have a query that I try in Microsoft SQL Server Management Studio, and this query work fine:
DECLARE @tableVariable TABLE (fecha DATE, valor Float);
INSERT @tableVariable SELECT fecha, valor FROM ...
0
votes
3answers
854 views
How to select rows from database based on username?
How do you select only rows that apply to the user currently signed in when using the Configure Data Source dialog? Right each row has a username that was created for them when they register. I am ...
0
votes
2answers
12k views
Change Gridview Datasource using ASP .NET SQLDATASOURCE
i have a gridview automaticly connecting with sqldatasource1, etc. For the grid, I also have a search textbox If the user needs to filter the records it calls an another ((sqldatasource2-another ...
0
votes
2answers
2k views
Add Stored Procedure Parameter into sqlDataSource, msSQL
I want to insert a value by using stored procedure in mssql. This is my stored procedure :
ALTER PROCEDURE dbo.insertNewMember
(@name varchar(30),
@age int )
AS
BEGIN
INSERT INTO member(memId, ...
0
votes
1answer
20 views
Insert Data retrieved from another row except one updated column
I would like to take all the data used in a previous row and insert it into a new row. However, in one column I will be using a new value. I am using a SqlDataSource in a FormView to show this ...
0
votes
1answer
38 views
How to use SqlDataSource with button on click to get results from gridview
My overall goal is to be able to type in information into my textbox and click a button to search and get results from the database using gridview. So far I have my SqlDataSource SQL statement set up. ...
0
votes
4answers
65 views
Pass is NULL instead of = Null
This is my sqldatasource
<asp:SqlDataSource runat="server" ID="get_client_users" ConnectionString="<%$ ConnectionStrings:local %>" SelectCommand="SELECT * FROM users WHERE clientid = ...
0
votes
1answer
123 views
Change Label Control Property Based on Data from SqlDataSource Inside a Repeater
I am using a repeater control to populate data from SqlDataSource into my custom designed display-box.
<asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1" ...
0
votes
2answers
665 views
How to get a gridview to show all table rows when no text is entered in a dependent textbox?
The below works correctly and filters my gridview based on the text entered in my textbox.
When no text is entered into my textbox I get no results and cannot understand why.
MY QUESTION
How to get ...
0
votes
2answers
918 views
Change Gridview Datasource or Select statement ijn code?
I have a gridview with sqldatasource, etc. For the grid, I also have
a search textbox. If the user needs to filter the records, I want to
dynamically adjust the SELECT statement for the SqlDataSource ...
0
votes
3answers
619 views
How do I force SqlDataSource to use varchar parameters?
I'm using a SqlDataSource to populate my GridView, because the two seem to be so tightly coupled together. Since this grid shows results of a search, I have a dynamic sql string being written in my ...
0
votes
0answers
23 views
Using a CheckBoxList as paramater for SqlDataSource
I'm trying to populate a GridView based on a CheckBoxList on the same page. The GridView works well, however, I can't find a way to only use the values from the CBL. I searched and tried a few things, ...
0
votes
0answers
13 views
dbo table not showing up in SqlDataSource control setup UI in Visual Studio
I have a database with two different tables, one of which I want to assign to a SqlDataSource control on my ASP.NET webform. When I go to the tasks menu (clicking on the arrow on the control in design ...
0
votes
1answer
129 views
asp.net sqldatasource parameter not supplied
OBJECTIVE: TO GET THE DELETE STORED PROCEDURE TO WORK
Hi,
I am creating a very simple CRUD (CREATE, READ, UPDATE, DELETE) test program in asp.net framework 4 which needs to have a table id as a ...
0
votes
0answers
121 views
Context variable cannot be resolved to a type MS SQL Server 2008 Tomcat 7 DataSource
I am trying to create a connection to an MS SQL Database using the context.xml and web.xml files but I am getting the following error:
An error occurred at line: 26 in the jsp file: ...
0
votes
1answer
581 views
Procedure or function x has too many arguments specified
I have a gridview with the following SqlDataSource:
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnString%>"
...
0
votes
0answers
52 views
Sql Stored Procedure Help Request
I am very new in stored procedure.
Developing own web application and for new requirement need to convert my SqlDataSource to Stored Procedure..
Here is my SqlDatasource and my first StoredProcedure ...
0
votes
1answer
22 views
C#, In a Mysql connection proprety connection.Server and connection.DataSource are always equals or there is a case where are different?
In my program I can see these proprietes are always equals, can be different in some exceptional case?
0
votes
0answers
192 views
Error in list of function arguments: 'SELECT' not recognized / ORA: 01008 not all variables bound
Why this block of code producing error in sqldatasource wizard in Visual studio ,
what i can do make it work ,
Is it a syntax error or what, if so please help me with a reference or a tool. thanks
...
0
votes
0answers
40 views
asp vb.net (or c#) sql table as collection
I am working with silverlight pivotviewer. It requires a collection of items as its source of data. I have a table/view in SQL that I would like to use as the source of data.
I know I can iterate ...
0
votes
0answers
698 views
insert into a database with a sqldatasource. asp.net mvc4
My problem is that when I click the button nothing happens to the sql server. When I look in the profiler I can see that my code reads from the database but nothing else. I have borrowed code from the ...
0
votes
2answers
231 views
Removing duplicates from sqldatasource
I'm trying to create a "Contact Us" page and I have a drop down list on this page using a SqlDataSource to pull the list from my database but my database has duplicate entrys that I do not want shown ...
0
votes
0answers
122 views
updating a single SQL table from a joined datagridview
So my problem is that i need to update a table on my database using a DataGridview bound to an SqlDataSource. the thing is that this DataGridview is a joined set of other tables from the same ...
0
votes
1answer
1k views
My GridView control bound to a SqlDataSource does not update
All the data is displayed correctly. Only the "Update" link isn't working. My code is:
<asp:SqlDataSource runat="server" ConnectionString="<%$ ConnectionStrings:DefaultConnection %>"
...
0
votes
0answers
320 views
Getting asp.net SqlDataSource table dynamically from query string
I'm getting SqlDatasource table from query string likes
<asp:SqlDataSource ID="myDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:MyConnectionString %>"
...
0
votes
1answer
115 views
Update grid row within a grid using a datasource
I might be posting tons of ASP.NET questions during the coming weeks because the place I'm working at during the summer gives me several things to add to their CRM system even though I have never ...
0
votes
0answers
304 views
VB.NET T-SQL error retrieving SCOPE_IDENTITY() value with SQLDATASOURCE
I'm using Scope_Identity() and I cannot figure out why the new ID value isn't being retrieved on insert. I was hoping someone could see what I am missing. I am getting the following error:
...