473,396 Members | 2,158 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Retrive the value from query string

109 100+
Hi all,

I need some help on retrive the value from query string.

I have two web forms. One has the datagridview which displays the data from database. On one of the column I made a hyperlink to go to next page

like, qi.aspx?qi_track={0} and now I need to open a detail of this qi_track on second page.

how can I extract the value of qitrack from the url.


and my second problem is:

I want to make my column value a hyperlink in datagrid view.

How can I make that happen.

for ex,

NAME
_______
A.J.
T.J
ETC.

value under name cloumn comes from database and I want a hyperlink under A.J., T.J. etc to open a new page.

Thank you in advanced for your help.

Thanks,
Jan 5 '08 #1
10 1744
kunal pawar
297 100+
In VB.Net

Request.Querystring("qi_track"), this return value for qi_track

In c#

Request.Querystring["qi_track"], this return value for qi_track
Jan 5 '08 #2
arial
109 100+
Thanks kunal.

But I still have another problem which about making a hyper link on one of the column's datavalue.

like,

name is the column name which holds people's name I need a hyperlink on each of this name to pull up their detail.

how can I do this?

Thanks,
Jan 7 '08 #3
Plater
7,872 Expert 4TB
Thanks kunal.

But I still have another problem which about making a hyper link on one of the column's datavalue.

like,

name is the column name which holds people's name I need a hyperlink on each of this name to pull up their detail.

how can I do this?

Thanks,
After you have the data in the gridview, you can do post proccess on it.
Changing what is in it's rows/columns at will.
Jan 7 '08 #4
arial
109 100+
Hi Plater,

Can you explain with example if possible?

I am still new to asp.net.

Thank you,
Jan 7 '08 #5
Plater
7,872 Expert 4TB
Hi Plater,

Can you explain with example if possible?

I am still new to asp.net.

Thank you,
Well here's a snipit from one of mine that changes a column to a hyperlink. You should be able to get an idea from it.
gvOverdueSites is the name of my gridview.
Expand|Select|Wrap|Line Numbers
  1. protected void procOverdueSites()
  2. {
  3.     string msg = "";
  4.     string href = "ManagerSiteInfo.aspx?siteid=";
  5.     if (gvOverdueSites.HeaderRow != null)
  6.     {
  7.         for (int i = 0; i < gvOverdueSites.Rows.Count; i++)
  8.         {
  9.             msg = gvOverdueSites.Rows[i].Cells[0].Text;
  10.             if (gvOverdueSites.HeaderRow.Cells[0].Text == "SiteID")
  11.             {
  12.                 HyperLink hl = new HyperLink();
  13.                 hl.Text = msg;
  14.                 hl.NavigateUrl = href + msg.Replace("&amp;", "&");
  15.                 gvOverdueSites.Rows[i].Cells[0].Controls.Add(hl);
  16.             }
  17.         }//end of forloop
  18.     }
  19. }
  20.  
Jan 7 '08 #6
arial
109 100+
Thanks Plater,

I will try.

Also, is might be a very silly question but I don't seem to figure it out.

I need to extract a last two character of a string matching "99".

My string can be a variable length so I think I can not use substring function.


How can I accomplish this?

Thanks,
Jan 7 '08 #7
arial
109 100+
Sorry but let me redefine my last problem.

I have string of unknown length but all these string will have initial value of current date.

Expand|Select|Wrap|Line Numbers
  1. for example, string str1 = 0801hello,
  2.                            str2 = 0801why
  3. etc. I need to extract only the character after the date. 
  4. I save the current date in a variable.
  5.  
  6. sqidate = DateTime.Now.ToString("yyMM");
  7.  
but now I am not sure how to match up the string with date varible("sqidate") and extract only the reset of the value.

Please help me.

Thank You,
Jan 8 '08 #8
Plater
7,872 Expert 4TB
if it's always 4digits for the date, just take a .SubString(4); this will skip the first 4 characters and take everything after it.
Jan 8 '08 #9
arial
109 100+
I recently find out that the data store in database removes the first zero from the value.
Expand|Select|Wrap|Line Numbers
  1. like for 2008 value is store like 801aaa, 801bbbb ect.
  2. and it will be for 2010, 1001aaa,1002bbb etc.
  3.  
so substring (4) would work for 2010 but what about 2008.

I like to do it in a way so that it will take care of all years like 2008,2009, 2010 and so on.

any suggestion?

Thank You,
Jan 8 '08 #10
Plater
7,872 Expert 4TB
I'm not sure I have you statements right.
I though you were using "yyMM" for your datestring, that is always 4digits.
If that is what is going to start every string, then all you have to do is skip 4digits.
Jan 8 '08 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Bruno Alexandre | last post by:
Hi guys, withou using SP, I want to be able to add a Parameter to the SQL Query and retrive the Recordset so I can use the Paging property under the recorset object.... how can I do this? I'm...
2
by: Goran | last post by:
I'm a student and I've just started to learn Visual Studio.NET. I have a project to make a web application. I have a problem to connect to the database and retriving the PassType of the...
2
by: partha das | last post by:
sir i need a single sql query it may be sub query need to retrive the 5th highest salary from a employee table
8
by: asenthil | last post by:
Hai, i'm having a string in a specific field of a database... now i want to retrive that string from the database and i have to write that string into a xml file.... retriving is not a...
0
by: weiwei | last post by:
Hi here is my scenario, I create a drop down list in itemtemplate.(that drop down is created from db), after user click edit command, my ideal plan is have another drop down list in...
0
by: varaprasad204 | last post by:
hai all..., i used to store my mp3 file into database by <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %> <%@ import Namespace="System.IO" %> <%@...
1
idsanjeev
by: idsanjeev | last post by:
hello i wants to retrive data in textarea like input text but in textarea value is not work so what should be use to retrive textarea value after any error <input type="text" name="name"...
1
by: amritranjan | last post by:
How to retrive image file from MS access database and display this in another JSPpage -------------------------------------------------------------------------------- This is my Jsp code for...
1
by: ganesh22 | last post by:
Hi, Here the below code is for dynamically creating textboxs, its creating fine but after user enters some values in textboxs how can i retrive that values? using System; using System.Data;...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.