|
Christian Graus wrote: but he said he doesn't want to use a timer.....
Yes I can read.
I mentioned it because I was trying to explain in my arguement that this is the only real valid way of doing it.
Sometimes people say they cant use a certain method so that they can get other possible solutions. In this case he will just have to use a method he doesnt really want to use.
|
|
|
|
|
.netman wrote: AJAX is the only way of doing this.
No. There are other options too, but they are quite complex to implement.
Have you ever heard of Comet[^], Push Model etc.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Hi all,
This is my dataview
<asp:GridView ID="bcgrid" runat="server" DataKeyNames="testi_ID" EditRowStyle-Font-Size="XX-Small" EditRowStyle-Font-Bold="true" Font-Names="Verdana" Font-Size="XX-Small" ForeColor="DimGray" Width="368px" AutoGenerateColumns="False" HorizontalAlign="Center" >
<Columns>
<asp:TemplateField HeaderText="Language"><ItemTemplate>
<asp:Label ID="p" runat="server" Text='<%#DataBinder.Eval(Container, "DataItem.testi_Language").ToString() %>'>
</asp:Label></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Description"><ItemTemplate>
<asp:Label ID="Lab" runat="server" Text='<%#DataBinder.Eval(Container, "DataItem.testi_Description").ToString() %>'></asp:Label>
</ItemTemplate> </asp:TemplateField>
<asp:TemplateField HeaderText="Category"><ItemTemplate>
<asp:Label ID="Lab" runat="server" Text='<%#DataBinder.Eval(Container, "DataItem.testi_Category").ToString() %>'></asp:Label>
</ItemTemplate> </asp:TemplateField>
<asp:TemplateField HeaderText="Title"><ItemTemplate>
<asp:HyperLink ID="HyperLink1" runat="server" Text='<%#DataBinder.Eval(Container, "DataItem.testi_Title").ToString() %>' NavigateUrl='<%#GetUrl(DataBinder.Eval(Container, "DataItem.testi_Name").ToString()) %>'></asp:HyperLink>
</ItemTemplate> </asp:TemplateField>
</Columns>
<EditRowStyle Font-Bold="True" Font-Names="Verdana" Font-Size="XX-Small" />
<RowStyle HorizontalAlign="Center" />
<HeaderStyle HorizontalAlign="Center" />
</asp:GridView>
This is the function for databinding
public void GetData()
{
// Create Instance of Connection and Command Object
SqlConnection conn = new SqlConnection("data source=ADMIN-6CB835BC2\\SQLEXPRESS;initial catalog=Gospel;integrated security=SSPI;Trusted_Connection=Yes");
conn.Open();
string sqlselect = "select * from Testimonial";
SqlCommand myCommand = new SqlCommand(sqlselect, conn);
SqlDataReader result = myCommand.ExecuteReader();
bcgrid.DataSource = result;
bcgrid.DataBind();
if (bcgrid.Rows.Count == 0)
{
bcgrid.Visible = false;
lblInfn.Visible = true;
}
else
{
bcgrid.Visible = true;
}
}
How can i apply paging to this grid.I am totally confused .Help me out with detailed information.
|
|
|
|
|
reogeo2008 wrote: How can i apply paging to this grid.I am totally confused
What is confusion to apply paging in this gridview?
Set AllowPaging=true,Set PageSize and Call PageIndexChanging event of GridView
On that event write this two lines
bcgrid.PageIndex = e.NewPageIndex;
//call getData method here to rebind gridview
GetData();
please don't forget to vote on the post that helped you.
|
|
|
|
|
I tried that already and getting the error "the data source does not support server-side data paging"
|
|
|
|
|
|
Hi
I am using a third party datepicker control in my ASP vb.net VS 2005 and AJAX.
The application is localised. The date control works fine with Sourec code in both English and local language. But when we run the web applicaiton after hosting on server, the application works fine for local language but not with english language. In english it always gives the today's date only.
Not able to figure out where i am missing out..Can any one help me out..
Thanks in advance.
|
|
|
|
|
Ramakrishna GS wrote: Can any one help me out
Probably the vendor would be your best bet - after all, they wrote it
Bob
Ashfield Consultants Ltd
|
|
|
|
|
ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
connection string is
HOST=localhost;Option=16834;Database=wesabe;Username=root; Password=tiwari" providerName="System.Data.Odbc" name="mycon1"
This is the first time i am using my sql
Please tell me where i got wrong ..
Thanks and regards
If You win You need not Explain............
But If You Loose You Should not be there to Explain......
|
|
|
|
|
|
thanks but i have seen this ..
Please if any one has a sample connection string (working )
then post here
thanks and regards
If You win You need not Explain............
But If You Loose You Should not be there to Explain......
|
|
|
|
|
|
I take it you have installed the MyODBC drivers as well? If not, I suggest you do, then try something like
DRIVER={MySQL ODBC 5.1 Driver};server=localhost;database=XXX;uid=XXX;pwd=XXX
(depending on what version of the driver they're up to now...)
PS you shouuldn't really post your logins in public, you know...
|
|
|
|
|
thank you friends for the response in the mean time i followed few things and got the things working
firstly adding a reference MySQlData.Dll
then
string con_Str =connectionString="SERVER=localhost; USER ID=root; PASSWORD=xxxx; database=xxxx;" providerName="MySql.Data.MySqlClient"
MySqlConnection my_connection = new MySqlConnection(con_Str);
and so on...
If You win You need not Explain............
But If You Loose You Should not be there to Explain......
|
|
|
|
|
Anyone here spent any time using VisualWebGUI[^]?
Is it any good? (I.E. worth investing in for a huge project?)
|
|
|
|
|
From their homepage: (my emphasis)
"Visual WebGui (VWG) is a new 'Web lioke Desktop' platform"
I wonder if it comes with a spell-checker?
|
|
|
|
|
I want to store Custom Class object to ViewState for later use
Note : I want to use ISeriable interface not [Serializable] property
(When i use [Serializable] property, it is working fine but in my case i
have to use only ISeriable Interface, I have option to store object into ViewState only not XML or File)
PlZ help me.
Sample.aspx
Person oPerson = new Person();
oPerson.FirstName = "Sandilian";
oPerson.LastName = "Arumugam";
ViewState["Object"] = oPerson;
Person cls1 = (Person)ViewState["Object"];
Response.Write(cls1.FirstName + " " + cls1.LastName);
Person.CS
//[Serializable]
public class Person : ISerializable
{
private string _FirstName;
private string _LastName;
public string FirstName
{
get { return _FirstName; }
set { _FirstName = value; }
}
public string LastName
{
get { return _LastName; }
set { _LastName = value; }
}
public Person()
{
}
public Person(string FirstName, string LastName)
{
this.FirstName = FirstName;
this.LastName = LastName;
}
public void GetObjectData(SerializationInfo oInfo, StreamingContext oContext)
{
oInfo.AddValue("FirstName", this.FirstName);
oInfo.AddValue("LastName", this.LastName);
oInfo.SetType(typeof(Person));
}
}
|
|
|
|
|
If you want to store it in directly ViewState, it must have the [Serializable] attribute. No other way. What is the problem with using the attribute?
|
|
|
|
|
PL do not accept this type of declaration. that is the problem . Can you suggest me some way to solve this problem.
|
|
|
|
|
Hello,
I have to display list of countries in below format using DataList and Gridview how can I do it.
A
Afganistan Albania
American Samoa Armenia
B
Bahamas Benin
C
Cameroon Canada
Regards,
Pavas
|
|
|
|
|
Your best bet is to get rid of the gridview and use a repeater. It simply gives you more control.
Why would you use a datalist AND a gridview ?
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
how to use the window service for autorefresh the datetime in asp .net with c#
|
|
|
|
|
For page auto refresh use this:
120 represents 120s (2 minutes) and index.php represents the page you wish to refresh!
|
|
|
|
|
can you give example for window service or web service
|
|
|
|
|
nithydurai wrote: use the window service for autorefresh the datetime in asp .net with c#
I am sorry, but this doesn't make any sense. Do you know what a windows service is ?
|
|
|
|