|
Can you give me a example?is it same like i am storing in a cache variable ?
Like this
Cache["dt"]=dttable;
dttable=(datatable) Cache["dt"];
can i use ?
Session["dt"]=dttable;
dttable=(datatable) Session["dt"];
if it's possible is it good to store a datatable to a seesion Variable?
|
|
|
|
|
You can go with second method. Cache is not user specific. It will be common for all users accessing website. Session keeps datatable user specific.
anujose wrote: if it's possible is it good to store a datatable to a seesion Variable?
This depends on the size of your datatable. If it is pretty big, then this method might cause performance issues. If it is small object then I think there is no issues.
|
|
|
|
|
I want to create photo gallery by adding photos in gallery by just dragging the files from external folder. This I have to do in asp.net.
|
|
|
|
|
|
Hi everyone,
Please recommend good dropdown (or something like that) color picker for asp.net 2.0, I do not want Advanced one, just to click and than select a color prom spectrum or from list, also I do not wand just simple dropdown with color names.
Thanks lot
|
|
|
|
|
totocaster wrote: also I do not wand just simple dropdown with color names.
Then you have to write one custom control.
|
|
|
|
|
and there are no already written ones?
|
|
|
|
|
I didn't find anything
|
|
|
|
|
|
found one!
http://www.codeproject.com/aspnet/ColorPicker.asp
|
|
|
|
|
is there ay other way to execute the reports other then the crystal reports viewer way?
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
Sonia Gupta wrote: other way
You mean rendering? You have builtin ways to export as PDF right? Acrobat Reader or FoxIT is quite common tool of every desktop.
|
|
|
|
|
if u please provide any link?
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
|
hello dude,
There is other way it is using a report viewer control.By that we can generate reports.Plz search and reply again i want the details about that control....i think we can generate report using SQL REPORTING SERVICES CONFIGURATION...
ok byeee
Murali
Murali
|
|
|
|
|
Hi Everyone,
I have 4 columns GridView.. One is BoundField This column is binded to Sno field from my Access Datasource.. 2nd, 3rd & 4th columns are TemplateFields (PartNo, Manufacturer, Qunatity) .. In this Template Fields, I have textboxes./.
Now, Below this Gridview i hv a Button (btnSubmit). What I am trying to do is when user enters values in to textboxes & click on Submit button, all the values should get update in the database..
To achieve this, i have written the following code:
<asp:GridView ID="myGridView1" runat="server" Width="483px" CellPadding="4" ForeColor="#333333" AutoGenerateColumns="False" DataSourceID="AccessDataSource1" OnSelectedIndexChanged="myGridView1_SelectedIndexChanged">
<Columns>
<asp:BoundField DataField="Sno" HeaderText="SNo" SortExpression="Sno"/>
<asp:TemplateField HeaderText="PartNo">
<ItemTemplate>
<asp:TextBox runat="server" ID="txtPartNo">
</asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Manufacturer">
<ItemTemplate>
<asp:TextBox runat="server" ID="txtMfg">
</asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Quantity">
<ItemTemplate>
<asp:TextBox runat="server" ID="txtQty">
</asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<RowStyle BackColor="#EFF3FB" />
<EditRowStyle BackColor="#2461BF" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
<asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/db1.mdb"
SelectCommand="SELECT [Sno] FROM [RfqInfo]" >
____________________________
protected void btnSubmit_Click(object sender, EventArgs e)
{
OleDbConnection myConnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Documents and Settings\\venki\\My Documents\\Visual Studio 2005\\WebSites\\RFQTest\\App_Data\\db1.mdb");
myConnection.Open();
string strQuery = string.Empty;
foreach(GridViewRow dgRow in myGridView1.Rows)
{
string str = ((TextBox)dgRow.FindControl("txtPartNo")).Text.ToString();
string str1 = ((TextBox)dgRow.FindControl("txtMfg")).Text.ToString();
string str2 = ((TextBox)dgRow.FindControl("txtQty")).Text.ToString();
strQuery = "UPDATE [RfqInfo] SET [Partno]= '" + str + "', [mfg] = '" + str1 + "', [qty] = '" + str2 + "'";
}
OleDbCommand cmd = new OleDbCommand(strQuery, myConnection);
cmd.ExecuteNonQuery();
myConnection.Close();
}
now, my problem is when i'm clicking on submit its updating the database with the values of last row in my gridview... i'm really lost here.... Anyone please help me........ Is there any wrong with my code? I have searched throughout the google but couldn't fine one...
Any help would be appreciated........
Thanks in Advance.
|
|
|
|
|
Hi DKalepu,
I think ,
string str = ((TextBox)dgRow.FindControl("txtPartNo")).Text.ToString();
this line your code giving you problem as you finding control but grid view is having rows of controls so it take last value and gives u ..
try to get values for perticular row .
try this ,
myGridView1.Rows[dgRow.RowIndex].FindControl("txtPartNo")).Text.ToString();
i am not sure ..try some R&D on this u will find answer
pallavi
|
|
|
|
|
Hi Pallavi,
thanks for reply.... I have tried it by debugging. oh but still, same problem..
the value gets stored in the last row position only...
can u plz give me any other advices.....
Thanks,
Durga.
|
|
|
|
|
hello sir,
Instead of keeping in ItemTemplate keep in EditItemTemplate..
ok It will work and plz check datasourceID and dataconnection ..I think only one should be declared.
Try like this ..
ok byee
Murali
Murali
|
|
|
|
|
Hi Murali,
i hv tried using EditItemTemplate as u said... but itisn't showing any textboxes there...
fyi, i'm a girl..
Thanks,
Durga.
|
|
|
|
|
hello durga,
in the edit item template u need to declare the asp:textbox it will not come automatically.try u will get...
ok byeee
Murali
|
|
|
|
|
I have tried it already, but it doesn't show up anything.....
|
|
|
|
|
hi durga,
put
OleDbCommand cmd = new OleDbCommand(strQuery, myConnection);
cmd.ExecuteNonQuery();
code in foreach loop .. now u will get what u want and put where cluase in your query
pallavi
|
|
|
|
|
Thanks for the kind help Pallavi.. My problem solved now..
|
|
|
|
|
Hi
in your code errore is in the this line "strQuery = "UPDATE [RfqInfo] SET [Partno]= '" + str + "', [mfg] = '" + str1 + "', [qty] = '" + str2 + "'";
"
you have not mantioned any whare condition for updating particuler row thats why when last time ur query get executed it update all rows by last row in ur gridview .
Hirdesh
|
|
|
|