sqldatasource

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 testMySQL.dbo.shoutbox FROM openquery(MYSQL, 'SELECT * FROM tigerdb.shoutbox')...etc ... etc... ...

Disable or hide row/column in detailsview when inserting?

When in insert mode detailsview, there are some parameters that I would like to disable or hide. The columns are autogenerated. Doesn't work: DetailsView3.Rows(5).Visible = False or DetailsView3.Rows(5).Enabled = False I'm lost. ...

How to set SelectedValue of DropDownList in GridView EditTemplate

I am trying to do this as asked earlier. The only difference that I found is additional List item that was included in above code. I tried to use AppendDataBoundItems=true but it is still not working. I also want to set the its default value to the value that was being displayed in label of itemtemplate i.e. DropDownList's SelectedValue...

Display dropdown menu in gridview with autogeneratecolumns enabled

I see a bunch of solutions about editing the template, but seeing as how my gridview changes between 10 different datasources a template isn't possible. Any idea of how I can accomplish this? ...

datagrid sql data source join

I have a table called Leaves. Fields are, * LeaveID * PersonID * ActingPersonID In Person's table, I have, * PersonalID * EmployeeCode * PersonName Now, in the datagrid, I need to show, * PersonEmployeeCode * PersonName * ActingPersonEmployeeCode * ActingPersonName Now, I know how to write the SQL Join to get the data populated....

Getting the parameter values being passed to SQL database via SQLDataSource control

I am debugging code written by a previous developer :-) I have a SQLDataSource control that is calling a database stored procedure, and passing quite a large number of paramaters, and the stored proc returns records that populates a gridview control. When I walk through the code behind to determine the values being passed, is ther...

Advanced manipulation on automatic data binding in .NET, architectural problem

I have application with following data flow: SqlDatabase -> SqlDataAdapter + SqlCommandBuilder -> DataSet -> DataGridView All conversions and bindings are automatic. This is all simple and functional and I can load all kinds of databases with simple code. Problem is with BLOBs, they are treated as Image in DataGridView. My question is...

Error converting data type nvarchar to datetime.

Using Vb.net/SQL Server 2000 updating a row via a gridview/sqldatasource Stored proc: @ISTag varchar(10), @PCISTag varchar(10), @User varchar(50), @Date_Start datetime, @Date_End datetime, @Status varchar(50), @Cost money, @Notes varchar(500), @CreatedBy varchar(50), @ModifiedBy varchar(50) AS BEGIN -- SET NOCOUNT ON added to preve...

Object must implement IConvertible?

Getting this after solving a "Error converting data type nvarchar to datetime" error. Using Vb.net/SQL Server 2000 updating a row via a gridview/sqldatasource: Stored Procedure: @ISTag varchar(10), @PCISTag varchar(10), @User varchar(50), @Date_Start datetime, @Date_End datetime, @Status varchar(50), @Cost money, @Notes varchar(500), @...

Gridview with different template per datasource

I have a gridview that I would like to be able to bind to several sqldatasources, but still use template fields. Each datasource is different and would have different columns so I'm not sure how to go about this. Is it possible to define a set of template fields or overlying template per datasource? ...

ASP.NET SqlDataSource set SessionParameter programatically

Hi guys, I have a StoredProcedure called "usp_posts_getall" and it has 1 parameter called "@thisCategoryID" in my "thisCategoryID", any values other than 0(zero) will return all the records in my Posts table. Now I have a category menu items and each time I select, I set the value in my Session name called "SelectedCID". So, How Do I...

ASP.NET SqlDataSource bulk update

MSDN Library has a walkthrough for bulk updates using a SqlDataSource. http://msdn.microsoft.com/en-us/library/aa992036(v=VS.90).aspx Not sure what I'm doing wrong, but I keep getting an error at: currentID = Convert.ToInt32(GridDocuments.DataKeys(0).Value) Are there other resources for SqlDataSource bulk updates? ...

Gridview SQL Parameter null from javascript/ajax populated dropdownlist.

Hello all. My issue is similar to http://stackoverflow.com/questions/2613627/how-to-use-the-value-of-a-selected-value-from-a-dropdownlist-populated-with-ajax but I am using ASP.NET, not PHP. I have a dropdownlist that is populated by another dropdownlist's current value through ajax. So if DDL A is 'NY', DDL B is populated with differe...

execute stored procedure using sqldatasource and get return value in vb.net

How can I execute a stored procedure using sqldatasource and get the return value in vb.net. Thanks, Terri ...

Pass string parameter to SqlDataSource in asp.net

i have placed a SqlDataSource component on my aspx page but while configuring the SqlDataSource in the "Test Query" Step I am passing the following parameters : But when i click ok it returns following error: This error occurs when i pass the string : INFO, WARN, ERROR, I have tried a lot of combinations but nothing works. It wor...

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 SQLdataSource that's all free. I need a grand total row, the contents of which I display outside the gridview. I know that I can get that b...

How to properly filter gridview bound to sqldatasource

I am trying to populate an (editable) gridview in ASP.NET with a table from SQL. I have a SQLDataSource set up for this. I also need to have this gridview be filterable based on parameters entered in textboxes. I have tried using ControlParameters for this and it works but the problem there is when all textboxes are empty I want it to di...

How to access the bound DataSource item in the ASP.NET ListView's DataBound event?

Hello everybody! I know the question has already been posted here but we didn't get to an real solution. I have bound my ListView to an SqlDataSource and I want to write some text in a control present in the view created in the LayoutTemplate depending on some properties of the rows returned. Obviously, I'm using the ItemDataBound eve...

How should I be using GridViews?

Recent problems I've had are making me question my whole philosophy and assumptions regarding GridViews. Currently, I have used something along the lines of the following model. In Markup: <asp:UpdatePanel ID="pnlSearch" UpdateMode="Conditional" runat="server"> <ContentTemplate> <asp:TextBox ID="txtSearch" runat="se...

asp.net gridview using parameter query to as400

I'm trying to retrieve as400 data into a gridview by passing a value to a parameter from data stored in a session variable, gathered from a text box. If I hardwire the query selection, it works fine, but trying to pass the parmameter gives the error: SQL0206: Column @myParm not in specified tables. I don't get this error when using tabl...