|
Hello ALL,
I want to display data in gridview,iam retriving data from database,
for example in a column named accno iam having 123,124,125,126
i want to display all the accno's in gridview in a single row
Thanks In Advance.
Ali
|
|
|
|
|
make a select comand in SQL like this:
select col1+''+col2+''+col3 from nyTable
and bind it on GridView as single column
I Love T-SQL
|
|
|
|
|
Hello Freind,
Thanks a lot i got the output what i want.
Once again thanks for your help.
Thanks & regards.
Taha Ali
|
|
|
|
|
u are welcome...
I Love T-SQL
|
|
|
|
|
I am doing some testing of the difference of an application that calls a web service for all database I/O and an application that uses embeded, direct connect, SQL calls. After testing it appears that the application that does the direct connect to the database runs faster then the one that uses the web service for the data I/O. This being the case, why would I use a web service for data I/O and not just use embeded SQL? Note: I am testing a server application that runs on Windows Server 2003 and a database running on a Sun machine. As far as the web service, it and the server application are both running on the same Server 2003 machine.
Thanks!
|
|
|
|
|
Generally, the advantage of WebService is that you can plug in multiple clients - Web interface, WinForms client etc. to the web service, and those clients don't need to have any knowledge about the database itself. Also, it is more maintainable, if anything changes on the db level, you need to change only the webservice, not every client.
Another point is a security, if you are accessing the database from WinForms client, anyone can reverse engineer the client app and see connection string or username/password combination. When you keep this information on the web service, only privileged users (users with log-on access to the server) can have possible access to this information.
However, if your scenario is restricted to ASP.NET application -> WebService -> DB server structure, I don't really see the point having the WebService, especially if the WebServer and the WebService are running on the same machine.
I would say you should build data access layer within your web application then.
Pilo
|
|
|
|
|
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "test1", "function CreatePopUP(url,popArguments ,titleStr){if(popArguments == null || popArguments == "") {popArguments = "dialogWidth:30;dialogHeight:25;help:no;status:no;resizable:yes;";PopReturnedValue = false;};PopReturnedValue = showModalDialog("default2.aspx");", true);
what is the error in this code? it has syntax error. does anybody know
|
|
|
|
|
{popArguments = "dialogWidth:30;
The " closes the " started at "function CreatePopUP
Try change to ' instead.
- Reelix
|
|
|
|
|
replace your " with \" in the javascript string, or use ' instead
|
|
|
|
|
i use this code in my form:
cell8.Controls.Add(new LiteralControl("<A HREF=" + "javascript:window.open('a.htm')" + " <span style=" + "font-size:9pt;" + "></span>Print</A>"));
where should be my page a.htm my mean is what is the path format. what should i write in window.open(????), my page a.htm is in this path : C:\webpart\WritingWebPart\Reservation
|
|
|
|
|
You can't use physical path, unless you want to use your web application only for yourself on your local computer. (Other users probably don't have the file on the same physical path)
If you have the a.htm file in the same folder as the file that contains the code above, then use just window.open('a.htm')
if not, then you still can use relative path, for example window.open('SubFolder/a.htm') or window.open('../a.htm')
THIS IS PREFERED WAY!
or if you know what is going to be the url of the a.htm, then use it:
window.open('www.myserver.com/myApp/a.htm')
Note that url shouldn't be hardcoded, but should be determined in runtime (as zour application might be deplozed on more than one server, or the server name can be changed)
Pilo
|
|
|
|
|
hey any one please help in acessing acessing labletext which is in grid view cell.
|
|
|
|
|
GridView1.Rows[1].Cells[1].Text;
ti will give you second cell's text of second row
I Love T-SQL
|
|
|
|
|
Or store the label as template field and use find control to find it
Using specific cells is a problem if you need to move columns about as you will then need to change the reference code to reference the correct cell
|
|
|
|
|
I agree with you, I just gived an idea how to get cell's text.
I Love T-SQL
|
|
|
|
|
All,
I am getting follwing error while reading my XML file directly returned from web service. This occurs normally when XML have some misplaced node, but my XML is returned from webservice with few chances to have node errors.
Can any one help me regarding this problem.
My error page is:
Server Error in '/portal' Application.--------------------------------------------------------------------------------
This is an unexpected token. The expected token is 'NAME'. Line 778, position 626.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Xml.XmlException: This is an unexpected token. The expected token is 'NAME'. Line 778, position 626.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
And my stack trace is:
[XmlException: This is an unexpected token. The expected token is 'NAME'. Line 778, position 626.]<br />
System.Xml.XmlTextReader.SetAttributeValues() +323<br />
System.Xml.XmlTextReader.ParseElement() +138<br />
System.Xml.XmlTextReader.Read() +94<br />
System.Xml.XmlValidatingReader.ReadNoCollectTextToken() +38<br />
System.Xml.XmlValidatingReader.Read() +14<br />
System.Xml.XmlLoader.LoadCurrentNode() +612<br />
System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc) +49<br />
System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace) +102<br />
System.Xml.XmlDocument.Load(XmlReader reader) +72<br />
System.Xml.XmlDocument.LoadXml(String xml) +163<br />
AI.Portal.Web.UI.RailBooking.ProcessGet()<br />
AI.Portal.Web.UI.BaseDialog.ProcessRequest()<br />
AI.Portal.Web.UI.HttpHandler.ProcessRequest(HttpContext context)<br />
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() +179<br />
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +87
I am using Microsoft .NET Framework Version:1.1.4322.2407; ASP.NET Version:1.1.4322.2407 Thanks in advance for any help.
Anand
Anand Desai
Developer
Atharva Infotech
modified on Tuesday, April 22, 2008 8:23 AM
|
|
|
|
|
and what is the token on line 778, position 626?
|
|
|
|
|
hi friends
i m using updatepanel for gridview..
i stuck with one problem.
The problem is
In my update panel i m using two button
one is imagebutton is a part of gridview &
othe is save button to save the grid...
Now when i click on that button first it call the Page_load and then the related buttonclick event....
i want that at page load can i know which button is clicked so that i call that function...
Plz tell me...
thanks
|
|
|
|
|
Why don't you call that function in the Button event itself ?
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
hi sandip
actually when i click on button that time first page load event is called and i just lost my dat in grid which i want to save
|
|
|
|
|
Are you adding GridView dynamically ?
Is ViewState Enable in your page ?
Let me know the details what are you trying in GridView and how you implemeneted it ?
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
yes i m creating it dynamically and i have two button one is to add new row and one is to save the rows from grid to database
and yes my grid viewstate is enabled
thanks
|
|
|
|
|
Add Grid View in Page_init method instead of Page Init
i think you are adding Grid view in page load ?
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
hey sandeep
when i add grid on page init it do not generate new row inside grid
|
|
|
|
|
hey sandip this is my
.aspx page
]]>
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<title>Untitled Page
function setHidVal(val)
{
debugger;
var ob=document.getElementById('tshf');
if(val=='Save')
{
ob.value=val;
}
else if(val=='AddRow')
{
ob.value=val;
}
}
<asp:scriptmanager id="ScriptManager1" runat="server">
AsyncPostBackTimeout="360"/>
<asp:label id="lblmy" runat="server">
<asp:updatepanel id="UpdatePanel1" runat="server">
<contenttemplate>
<asp:hiddenfield runat="server" id="tshf" value="">
<asp:gridview id="grdnew" runat="server" enableviewstate="true">
Style="z-index: 100; left: 53px; position: absolute;top: 81px"
CellPadding="4" ForeColor="#333333"
GridLines="None" AutoGenerateColumns="false">
<footerstyle backcolor="#990000" font-bold="True" forecolor="White">
<rowstyle backcolor="#FFFBD6" forecolor="#333333">
<selectedrowstyle backcolor="#FFCC66" font-bold="True" forecolor="Navy">
<pagerstyle backcolor="#FFCC66" forecolor="#333333" horizontalalign="Center">
<headerstyle backcolor="#990000" font-bold="True" forecolor="White">
<alternatingrowstyle backcolor="White">
<columns><asp:templatefield>
<headertemplate>
<asp:label id="lblimg" runat="server" text=" ">
<itemtemplate>
<asp:imagebutton id="btnimgadd" runat="server" imageurl="~/add.gif">
ToolTip="Add Row" OnClick="bUpdate1_Click"
OnClientClick="javascript:setHidVal('AddRow');" />
<columns><asp:templatefield>
<headertemplate>
<asp:label id="Label1" runat="server" text="Name">
<itemtemplate>
<asp:textbox id="TextBox1" runat="server">
EnableViewState="true" Text='<%# Eval("Name")%>' Width ="100px" />
<columns><asp:templatefield>
<headertemplate>
<asp:label id="Label2" runat="server" text="ContactNo">
<itemtemplate>
<asp:textbox id="TextBox2" runat="server">
EnableViewState="true" Text='<%# Eval("contactNo")%>' Width ="100px" />
<columns><asp:templatefield>
<headertemplate>
<asp:label id="Label3" runat="server" text="Email">
<itemtemplate>
<asp:textbox id="TextBox3" runat="server">
EnableViewState="true" Text='<%# Eval("email")%>' Width ="100px"/>
<columns><asp:templatefield>
<headertemplate>
<asp:label id="Label4" runat="server" text="Designation">
<itemtemplate>
<asp:dropdownlist runat="server">
DataTextField="DesignationName" DataValueField="pkDesignationID"
EnableViewState="true" ID="ddldesg" Width="100px">
<asp:textbox id="TextBox4" runat="server">
EnableViewState="true" Text='<%# Eval("designation")%>'
Width ="100px" Visible="false"/>
--%>]]>
<asp:button id="btnSave" runat="server" text="Save" onclick="btnSave_Click">
OnClientClick="javascript:setHidVal('Save');" />
<triggers>--%>]]>
<asp:asyncpostbacktrigger controlid="btnSave" eventname="Click">
<asp:updateprogress id="UpdateProgress1" runat="server">
AssociatedUpdatePanelID="UpdatePanel1">
<progresstemplate>
Getting Data From Server.....
|
|
|
|