How to use a full column name (table name and column name) with a DataReader
Hi, I have a problem retrieving the data with a DataReader from a stored proc that performs a join of two table with the same column's names but different data.
Let me explain with an example:
I have two tables:
Table1: Id, Name
Table2: Id, Name, IdTable1
The sproc is something like this:
CREATE PROCEDURE [dbo].[SearchByName]
FROM dbo.Table1, dbo.Table2
WHERE Table1.Id = Table2.IdTable1
AND Table1.Name LIKE '%' + @Name + '%'
And my c# code is something like this:
Database db = Databas...Need query to get distinct column name and details based on that column using sql server 2000
iam having three tables as shown below
table 1 table 2 &...DW Designer Column Name vs. Database Column name use in expressions
Can you access the DW Designer column name in expressions (I have used the
database column name, but have had no luck figuring out how to access the
Designer column name).
I'm not sure you can. What are you trying to accomplish? There might
be another way of doing it.
Download an evaluation version of DataWindow .NET 1.5 Today!:
DataWindow.NET code examples available on CodeXchange:
PowerBuilder 10.5 Bet...Using @column = [column] SQL Server 2000
Should the following select statement return ALL the records including the records where [district] is null? Currently it is only returning non null records. I tried it with a default value and without with the same results.
SelectCommand="SELECT [ID], [last], [first], [district], [TA] FROM [regd] Where ([district] Like case when @district is null then [district] else @district end)"
<SelectParameters ><asp:ControlParameter ControlID="Last_textbox" Name="district" defaultvalue="%" PropertyName="Text" Type="Str...Get Column Number Using Column Name
This ones burning me because, I am sure i've done it before and It's simply
slipping my mind.
I need to be able to get a column number using the column name.
i.e. Column name = 'effective_date'.
Using effective date - get the column number that belongs to effective
Any help is appreciated!!
> This ones burning me because, I am sure i've done it before and It's simply
> slipping my mind.
...Showing my own column names instead of database column names in datagridview-windows app. C#.net
HiI already bind a DataGridView to a databse. My DataGridView is showing column names as it is in the table. I want to show user-friendly column names in the grid instead of column names in the database table. Please help me in this reagard. Thanx in advance
Your statement indicates to me that your columns are dynamically added to the grid, that's why it's showing the database column names.
You can show user-friendly column names by changing your query like so:
SELECT fName as 'First Name' FROM Users.DarmarkMark as Answer, if this reply answers your post.
Go to "E...validation message using column label, not column name
win2k / pb8.01
When I forget to enter a required value on a dw, I get a MessageBox like
Required value missing for COLUMN NAME on row N
Please enter a value
For legacy reasons my column name is called lineval and can't be changed
I have set a column label in the datawindow painter to "Line Value" which
would look a lot nicer in an error message.
Is there anyway to specify in the dw to use the column label instead of the
column name in the error message ?
Well that's not a PB-generated error, so it must be in your code somewhere...how to fetch column using column index in sql server.
I have several columns in my table, but I want to fetch data using column index instead of column name in select command.
is there any way to do this.Please remember to click “Mark as Answer” on the post that helps youJasim AkhtarNew Delhi ( INDIA )
Yes there is.It's called dynamic SQL and it's a complicated process.See http://www.sommarskog.se/dynamic_sql.html Please click "Mark as Answer" if my reply solved your problem.CheersRammohan...SQL Msg 107 Error... The column prefix does not match with a table name or alias name used in the query.
Can someone please answer a problem that I've run into. I know that it's probably something stupid. I keep getting this error:Server: Msg 107, Level 16, State 3, Line 1The column prefix 'vFirstTimeEntered' does not match with a table name or alias name used in the query.Here is my query:-----------------------------------------------------------------Update TimeSheetSectionSet TimesheetSection.SECSTARTDT = vFirstTimeEntered.schlstuidWhere timesheetsection.schlstuid = vFirstTimeEntered.schlstuid AND timesheetsection.sectionid = vFirstTimeEntered.sectionid AND&...get column value in DW expression without column name
I've got a common experssion that I'd like to put on every
bold column property: I'd like set the column font to bold
if the previous column value is equal to the current. As I
have many columns, even dynamic columns, I don't know their
name in order to set an expression like this: "if (col_name
= col_name[-1], ...)"
So any idea?
get all object names using the expression
"datawindow.objects", split this tab separated
list into single object names, check every object
wether it is a column using the expression
&quo...When is a column not a column?
I have several extremely similar datawindows that I have to maintain that go
against the same table. Recently, I had to add a column to that table, and
also add the column to ALL of these datawindows that go against this table.
I added the column to the first datawindow, set up the edit control style,
etc. I then did a copy/paste of the columns edit control to the remaining
dw's (of course remembering to first add the column in SQL). Everything
(update props, column specs, column props) seems to indicate that the pasted
column is linked to the column I selected, HOWEVER, when I...Hiding columns in the ItemDataBound event without using the column index
Lately I've needed to hide certain columns in DataGrids depending on the specific data source so I create a property at the top of the page like so:
private string DisplayProjDesc
//DisplayProjDesc property - for ItemDataBound event of the DataGrids to determine whether to display project description
this.lblBoolDispProjDesc.Text = value;
}Then, in the ItemDataBound event of the DatGrid, I use something like:
this.dgProject....VB.NET 1.1 Searching through DataList Column by Column
Hi,I am trying to search through a DataList column by column. I am doing this so that if each cell within that sector is empty then I will hide that column. I have implemented a quick function in order to do this, however, it is searching through the datalist row by row. Below is my code, with explanations of what the code is trying to do. I think the problem is to do with the String sector. Is there anyway that I can change the sector string so that it will iterate through the table (dataset) column by column.Code:Dim myData As Data.DataSet = dbAccess.getChildr...How to place in DataGrids’s first column table’s column name, in second Datagrid’s column table’s column value?
Hello I use
C#. I’m interesting are there samples solved my problem.
You will need to loop through the datasource of the datagrid or through the datagrid items and fetch the values for the second datagrid.Sonu Kapoor [MVP] Feel free to ask me any .NET question | Ajax Data Controls Forum
Thank you! I solved my problem at the server cite.