DataSource Controls :: Extract Selected Data From Column?

Apr 15, 2010

i hve a data column containing data in this format...

1234-ab-1234
123-xy-123
12-ab-12
123-xy-123
1234-a-1234
12-s-1234
1234-xy-1234

how can i extract data between hyphens (ab, xy, a, s).. i need to extract distinct data only...

View 4 Replies


Similar Messages:

DataSource Controls :: How To Extract Specified Data From The Column

Apr 9, 2010

i have a data column which contains data in the folowing format :

12345-ABC-1234
1234-AB-123
123-A-12

how can i retrive columns based on the characters between the hyphens

e.g. only those columns which contain AB between hyphens(-)..

View 2 Replies

DataSource Controls :: Update Table Where Column Name Is Selected Dynamically C# / VB.NET

Mar 10, 2010

I want to Update Column of a Table where ColumnName will be DropDown.SelectedValue. Example: A set of RECORDS will be displayed from a Customer Table where CUstNo ='1234' and City= 'Chicago' and Grade ='B' Once displayed I want to Update the grade to 'A' of all those customers from the above criteria. In My case I have like 100 Columns, so in where Clause Column Names will be selected from a DropDown. In My Query, Update Customer SET ColumnName= 'some value' where ColumnName ='ActualValue' So how can I pass the ColumnName which is Dropdown Selected Value. I believe I can't give as Update Customer SET DropDown.SelectedValue = 'some value' where DropDown.SelectedValue ='ActualValue' how can I resolve this ?...

View 9 Replies

Forms Data Controls :: Making Visible Of Gridviwe Column If All Values In Selected In A Column Is Not Null

Dec 30, 2010

I have gridviwe having 2 columns:

1) DocNumber 2)Title

query select docnumber,title from tbl_docs.

BindwithGridviwe(sql);

Now the issue is that that every document doesn't has document number. I want to make invisible the docuNumber column of the grid viwe if all values in the docNumber retrieved are null.for example:

docnumber tite
null Document 1

null Document 2

null doucment 3

null document 4

if returned result match above where all docnumber are null then make the gridviwe docnumber column ivisible eslemake the greidviwe column visible.

View 4 Replies

Data Controls :: Get Column Index Of A Selected Column In GridView

Feb 3, 2014

I have a grid view with 4 columns and 12 rows.  Getting the row index is not problem; ;however, I cannot find a way to get the column index of the cell that i select.

View 1 Replies

Forms Data Controls :: How To Extract Value From A Dropdownlist After Bind 7 Column Name In A Dropdownlist

Mar 29, 2011

I have a table and 7 column name.

I bind the 7 column name in one dropdownlist.

Now the problem is,how do I extract the data value in a dropdownlist?

For example,

Dropdownlist contain 7 column name

-subject_name

-subject_code

-venue

-time

-seat_no

-admission_no

-subject_id

when I click the subject_name,I want it to appear in a gridview

Example

Math|9.00-10.00|Hall|18|09090J|...

Below is my current codes which I have a problem.

protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection("Data Source= EN\SQLEXPRESS;" + "Initial Catalog=ms;Integrated Security=SSPI");
SqlDataAdapter adapSel;
string mySQL = "SELECT '" + dd_list.SelectedValue+ "' FROM examtimetable ";
adapSel = new SqlDataAdapter(mySQL, conn);
conn.Open();
DataSet dsSel = new DataSet();
adapSel.Fill(dsSel);
GridView1.DataSource = dsSel;
GridView1.DataBind();
conn.Close();
}
Previously I have bind 7 column name in my dropdownlist
protected void Page_Load(object sender, EventArgs e)
{
if (Page.IsPostBack == false)
{
SqlConnection conn = new SqlConnection("Data Source= EN\SQLEXPRESS;" + "Initial Catalog=ms;Integrated Security=SSPI");
SqlCommand sqlCmd = new SqlCommand("select column_name from information_schema.columns where table_name='examtimetable' and COLUMN_NAME not like '%ID'", conn);
conn.Open();
SqlDataReader ds;
ds = sqlCmd.ExecuteReader();
dd_list.Items.Clear();
dd_list.DataSource = ds;
dd_list.DataTextField = "Column_Name";
dd_list.DataValueField = "Column_Name";
dd_list.DataBind();
dd_list.Items.Insert(0, "Select Option");
ds.Close();
conn.Close();
}
}

View 10 Replies

DataSource Controls :: SQL Datasource / To Show A Message That There Is No Data Selected?

Mar 2, 2010

ASP.net SQL datasource C# code behind

I want the webpage to show a message that there is no data selected,

Instead of showing blank details view

here is a picture of blank details view:

[URL=http://img28.imageshack.us/i/errorks.jpg/][IMG]http://img28.imageshack.us/img28/4328/errorks.jpg[/IMG][/URL]

What C# code do i need to use so that, whenever I enter that page, only an error message will show up

instead of the details view ..etc.

View 3 Replies

Forms Data Controls :: Update Selected Column In Gridview?

Oct 21, 2010

I have a gridview with an edit command button. When I press the edit button, it makes all the columns of the selected row editable. But I want it to make only few columns of the selected row to be editable...how can I do that?

View 3 Replies

Forms Data Controls :: Getting The Headertext Of A Selected Column When Autopostback?

Sep 23, 2010

I have a grid which is getting bound from a dataset and the autogeneratecolumns prperty is set to true.

Now i have a menu control. And when i select a particular cell, I want to headertext of the cell selected should appear as the text of the menu item.

But because autogeneratecolumns = true, so i gridview.columns.count=0. So not able to get the header text.

The code goes as follows.

[Code]....

View 2 Replies

Forms Data Controls :: Access Value Of Column In Selected Row In Gridview

Nov 9, 2010

I have seen a lot of things on the net on this but nothing seems to work. I have a GridView with name and other information on files stored in a database but also on a Server. I display the gridview with the files and the user selects the file to delete (row) by hitting the command field for Delete. I have an event on the gridview for code behind. Here I want to access the file name for the row selected, to be able to include it in the File.Delete statement.

Even before this I want to display the selected file name in a label back to the web page. I have tried everything including findcontrol selectedValue, etc. Nothing is working. I either get complier error, or nothing is displayed in label. If I let it go the the File.Delete step I get access error becasue there is no file name. HELP. here is screen shot of the gridview. Ignore the download button for now. That is my next headache to figure out. So based on the screen shot I want the value of log_doc from the gridview. It is in a column called file_name

File ID
File Name
Log
Upload Date
Uploaded By
Download
Delete
3

View 5 Replies

Forms Data Controls :: Comparing Selected Value Against GridView Column?

Oct 12, 2010

I have a GridView Column "Gender". After displaying datagrid, I m selecting dropdown which is not in datagrid.

Dropdown list is in the same page. When I select dropdown Gender as male or female, I have to validate that Gender against GridView Column. If that Gender Exist in GridView, I have to display message.

View 9 Replies

DataSource Controls :: How To Extract First 3 Digits From A DropDownMenu

Apr 21, 2010

I have a web form where there are couple of DDL's; DDL1 and DDL2 respectively. I want the DDL2 to be populated based on what option is selected in DDL1. Also I just want to extract the first three digits of the value selected in DDL1 and use it in the WHERE clause of the SQL query used to generate DDL2.

My prob is that I am not able to extract the first three digits out of DDL1 to be compared to another field from the DB in the WHERE clause of the SQL query for DDL2.

Here is my code for DDL2

[Code]....

View 15 Replies

Forms Data Controls :: Grouping The Data Rows Of The Grid View Under The Column Selected?

Sep 22, 2010

I have a grid view that needs to be shown group wise. The grouping of the data should be dynamic and that is based on the column that is selected.

In general it should list all the rows and based on the coloumn header selected, all the rows should group by that column and should be listed under it. That also needs the template column for the check box and while group by there should be a check all option available for each group.

Even having the collapse and expand option for each groups is required.

I currently use VS 2005 and later will use 2008 and 2010, but will use the aspx code and not xaml.

View 2 Replies

Forms Data Controls :: Find Index Of Selected Column In Asp Gridview?

Mar 13, 2011

i know how to find the index of selected row in asp gridview , but i need to find the index of selected column in asp gridview ?for ex:i have i gridview contains columns with header ( the header is the primary key i looking for ) , this grid contain linkbutton , i want to get the column header name on click on linkbutton ?

View 5 Replies

DataSource Controls :: Extract Numerical Digits From A String?

Mar 18, 2010

I need to extract numerical digits from a string using sql in a select statement

"Customer is eligible for Balance Billing with $10 credit on the next bill. Fixed monthly Balance Billing amount is $141.38. Offer is valid till the end of March 31, 2010."

I need ot extract 141.38 from teh above text.The length of the decimal can vary

View 5 Replies

Forms Data Controls :: Updating The Datasource / Mark All The Values In The Binding Column Of Datasource If Checkbox In Headertemplate Is Checked?

Sep 29, 2010

Scenario:
I am creating a custom gridview control which has a custom CheckBoxTemplateField column (deriving from TemplateField class). This template field column has custom Checkboxheadertemplate (implementing ITemplate) and CheckboxItemTemplate (also implementing ITemplate). In InstantiateIn method of both templates (header as well as Item template), I am adding a checkbox control which has Autopostback = true.

My requirement is:
I want to mark all the values in the binding column of datasource if checkbox in headertemplate is checked. I dont want to mark only rows visible on grid. I WANT TO MARK ALL ROWS IN DATASOURCE. I want to do this in _CheckedChanged event of checkbox in header template.

Problem I am facing: When I check/uncheck the checkbox in header, it postbacks. so in OnCheckedChanged event, gridview's datasource is null. Secondly, in any event of gridview, I could access only those rows of datasource for which corresponding rows are visible in gridview through Gridviewrow.DataItem property. But I want to set it for all rows in datasource.

View 5 Replies

Forms Data Controls :: Import Selected Row And Column From Excel File To Gridview?

Nov 10, 2010

How do i import selected row and columm from excel file to gridview? I have 9 rows in the excel file. I would like to display only 3 rows.

View 3 Replies

Data Controls :: Sort GridView Based On Column Name Specified In Selected Radio Button

Jan 4, 2013

i need to sort the gridview based on the radiobuttons. and i have 3 radiobuttons like dept,empcode,reporter..

if i click on any of radiobutton i need to show the gridview by sorting order..

View 1 Replies

DataSource Controls :: Uniquely Extract Tables From Database Schema?

Jun 11, 2010

I am looking for a fast way (either by script or Query statements) that would enable me uniquely extract some tables from my database schema.

The tables I wish to extract have some unique columns like x and y coordinate columns and i want to extract only the tables that have these coulmns in them.

My database schema is very large with 100s of tables that i cant just go through the tables one by one.

View 4 Replies

DataSource Controls :: Extract Specific Word In Sql If The Field Contain Comma?

Feb 24, 2010

how can i split the frist word in sql if the field contain ',' otherwise, only show the data value.

if the field is 'A,B,C'

I would like to select A as a result.

View 3 Replies

SQL Server :: Extract Words From One Column?

Mar 21, 2011

I am having one column named Location in My MS SQL 2008 Database and the values in the Column is like "Region/State/City" region, city and states are saperated by forward slash.

In that column some times City is given and somtime it is not provided means only Region and state.

Now, i need to extract that Region, state and city from one column to a view and in view there should be three columns State ,City and region.

I have tried the SUBString but it works on no. of characters but for different city and regions the no.

View 3 Replies

Extract Text And Image From A Pdf In A Selected Area Or Coordinates

Mar 11, 2010

I have a specific requirement of extracting text and images from a specific area in a pdf file.The area might be a selected or highlighted or from a given set of coordinates.

When i went through, all the approaches are to extract images and text entirely from the PDF on not in a specified location. I tried with iTextSharp,Syncfussion,Apose but couldn figure out a better approach for this.

View 1 Replies

SQL Server :: Extract Part Of A String / Insert This Column Into Table2

Mar 29, 2011

I have a table1 with first column having: usjim, uskim, uspeter, john ....

I need to insert this column into table2 excluding us if contains any ( extract substring basically)

I have tried doing this but doesn't work

[code]....

View 2 Replies

DataSource Controls :: Accessing Specific Column In Database With Column ID With Table Adaptor

Jan 6, 2010

I'm currectly tryin to access a specific value in my database in a specific column. I'm tryin to use the primary key of the table to access the actual value in the row of that ID.

The current code:

[Code]....

Just iterates through the table and looking for any row with the boolean 'checkin' value is True, then it takes the 'id' value of that row and stores it into an array. Is there a way that I can access a another entry, and only that entry, in the table with the 'id' stored in the array?

Like if my data base contained and int, primarykey, `id` value, a boolean, `checkedin` value, and a `time` value, is there a way to access, lets say, the row with `id` equalling 3 and and the checkIn value from that row?

View 2 Replies

DataSource Controls :: Split One Data Column Into Many?

Aug 4, 2010

I've a database table contains survey questions and answers. But the problem is both 'question' and 'answer' are saved in the same column(like below).

SubmissionDate Submission
2010-02-15 14:53:59.657 ***What's your pet's name?*** Lili ***Tell us about yourself*** I'm a teacher
2010-02-15 14:53:59.657 ***What's your pet's name?*** Lucy ***Tell us about yourself*** I'm a five star cook

I'd like to use a simple datagrid to display the survey result, but I need to separate the submission column into multiple columns ('question' as column name, 'answer' as data) the number of questions or questions being asked are different for each survey so they are not fixed. Is it even possible to get something like this below in a gridview?

SubmissionDate What's your pet's name? Tell us about yourself
2010-02-15 14:53:59.657 Lili I'm a teacher
2010-02-15 14:53:59.657 Lucy I'm a five star cook

View 11 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved