|
Is there anyone who can assist me in SEO for blogging. I want know how google search the content of blogs which stored in SQL Server. Please give me some details. I want anyone to search blogs content thru google.com of my website bolgs.
Thanx in advance
|
|
|
|
|
I am setting checked list box data source in the below format.
id Name Gender
1 Name 1 Male
2 Name 2 Fe Male
3 Name 3 Male
here am setting Name as DataTextField and id as DataValueField. In SelectedIndex changed i want to retrive Gender value. I can retrive id and name . If anyone know how to retriving a particular column from checked list box please help
|
|
|
|
|
You can do it in 2 ways..!
1)while retrieving the query append ID+Gender to one field wit separator and add it to DataValueField ,split the data value field you will get Id and Gender ..
2)Otherwise with the help of Id
vineesh v wrote: checked list box
start from here
http://www.w3schools.com/aspnet/control_checkboxlist.asp[^]
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
I have a .Net Application in C# which connects to an Oracle 10g R2 database, but when the application is running and it is accessing the database more and more sessions are being created and opened. This happens until the application crashes and no one can access the database.
Checking the database using a query in SQLPlus and looking at v$Session, I can see a large number of open sessions. This is despite the application opening and closing connections to the database.
Therefore, I looking for a solution which I can either pool sessions, i.e. users can use them and hand them back, or can close them after unloading a page, or something else.
Can someone help me, please
|
|
|
|
|
Right Im starting to look at web programming and need a bit of help.
And im starting at the deepend, I was looking at a tutorial on this site for an Ajax style chat program. In the code it uses javascript callbacks to log the user out. Wrapping my head around the way the client calls the server and the program responds was difficult and I want to see if I have this right.
These are the two java script functions I am using. The LogMeOut function get called on a button click.
function LogOutUser(result, context) {
alert("test")
alert(result)
}
function LogMeOut() {
LogOutUserCallBack();
}
and here is how they are registered.
string callBackReference = Page.ClientScript.GetCallbackEventReference(this, "arg", "LogOutUser", "", false);
string logoutScript = "function LogOutUserCallBack(arg, context) { " + callBackReference + "; }";
Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "LogOutUserCallBack", logoutScript, true);
So let me see if I have the logic for this right.
The callback reference going to create a call to the server side ICallbackEventHandler.RaiseCallbackEvent
using the client side WebForm_DoCallback function. And the LogOutUser function is the resultHandler.
The RegisterClientScriptBlock and logoutScript just add the function which wraps the WebForm_DoCallback reference to the client page.
The format for the clientCallback function has to be func(result, context).
of which the value of result is the value passed back from the server function ICallbackEventHandler.GetCallbackResult().
I think I have that figured out correctly but I have a few question remaining, as well as a problem.
I have a problem with the "alert("test")". when I run the program no alert pops up. But If I debug through it with FireBug it does ! Im fairly it get called when not debugging but not sure why the alert doesnt get called. And my breakpoint on the same line in Firebug doesnt get called !
The next question is basically my lack of understanding of the whole system and the role that WebResource and ScriptResource axd files play. Are these just two large file that the client has to download with the aspx page to get the page to run AJAX ? or how are these managed ?
I know this is a lot but I would really appreciate a bit of guidance.
Many Thanks
|
|
|
|
|
el_scrub wrote: Im starting to look at web programming
You should start with something a little less involved. I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I though these would have been fairly basic questions !
Its seemed a basic enough chat tutorial !
|
|
|
|
|
Hello All,
I found the article on SearchableGridView to be most helpful because it functions exactly how my client wants it. I converted the C# code to VB and created a new class file in my web application, naming it SearchGridView.vb. I inserted the converted code, referenced the namespace in web.config and added an import namespace to my content page.
Unfortunately, I receive the following error:
Warning 1 Namespace or type specified in the project-level Imports 'MyApp.WebControls' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases. DielWebProj
Here's the first bit of SearchGridView.vb:
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Text
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Drawing.Design
<Assembly: TagPrefix("MyApp.WebControls", "SearchGridView")>
Namespace MyApp.WebControls
#Region "TemplateColumn"
Public Class NumberColumn
Implements ITemplate
Public Sub InstantiateIn(ByVal container As System.Web.UI.Control) Implements System.Web.UI.ITemplate.InstantiateIn
End Sub
End Class
#End Region
<ToolboxData("<{0}:SearchGridView runat=server></{0}:SearchGridView>")> _
<ParseChildren(True, "SearchFilters")> _
Public Class SearchGridView
Inherits GridView
Can anyone identify where I've gone wrong? How do I rectify this issue?
Thanks,
Sid
|
|
|
|
|
Does anyone have an example of an AJAX.NET WEB Framework 3.5 service returning a DataTable object. I am having a problem with the proxy returning the correct value from the server. A woorking example would be a big help Thanks
|
|
|
|
|
Is Google broken? I know the language. I've read a book. - _Madmatt
|
|
|
|
|
No, I've checked this for you
Google Replied: Results 1 - 10 of about 10,700,000 for ajax examples. (0.27 seconds)
Antoine de Saint-Exupery: Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
|
|
|
|
|
Of course Goolge isn't broken, I was directing it at the OP ID 10 T I know the language. I've read a book. - _Madmatt
|
|
|
|
|
It was, in fact a joke (hence the smiley), reinforcing the fact he hadn't even bothered to google.... Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
|
|
|
|
|
hi, Im going to resolve requested url, and catch related query string (request) from url
for example when client try to redirect to www.mysite.com/myname, it change to www.mysite.com/?page=myname
exactly no page exist named myname
Response.Request["page"] return Query String i know , but the url must be formatted struct.modified on Saturday, February 13, 2010 6:32 PM
|
|
|
|
|
Could you please elaborate what exactly you are looking for?
|
|
|
|
|
|
|
Thanks a lot, i really need this.
|
|
|
|
|
<asp:EntityDataSource ID="srcCity" runat="server" ContextTypeName="Namespace.Core.Tracking.Domain" EntitySetName="Cities"
EntityTypeFilter="City" Include="Country" AutoGenerateWhereClause="true"/>
<WhereParameters/>
<asp:QueryStringParameter Name="Country.ID" Type="Int32"
QueryStringField="CountryID" />
</WhereParameters>
</asp:EntityDataSource>
<asp:EntityDataSource ID="srcCountry" runat="server" ContextTypeName="Namespace.Core.Tracking.Domain"
EntitySetName="Countries" EntityTypeFilter="Country" OrderBy="it.Name"/>
<asp:GridView ID="grid" runat="server" AutoGenerateColumns="False" DataKeyNames="ID" DataSourceID="srcCity">
<MasterTableView DataSourceID="srcCity" EditMode="InPlace">
<asp:TemplateField>
<asp:Label ID="lblName" runat="server"
Text='<%# Eval("Country.Name") %>'/>
</asp:TemplateField>
<EditItemTemplate>
<asp:DropDownList ID="lstCountry" runat="server"
SelectedValue='<%# Eval("ID") %>'DataSourceID="srcCountry"
DataTextField="Name" DataValueField="ID"
AppendDataBoundItems="true">
<ListItems>
<asp:ListItem Text="" Value="" />
</ListItems>
</DropDownList>
</EditItemTemplate>
</MasterTableView>
</GridView>
public partial class City : System.Web.UI.Page{
protected void Page_Load(object sender, EventArgs e){
grid.RowCreated += new GridViewRowEventHandler(grid_RowCreated);
}
void grid_RowCreated(object sender, GridViewRowEventArgs e){
if (e.Row.DataItem != null){
var city = EntityDataSourceExtensions.GetItemObject<City>(e.Row.DataItem);
if(city.Country != null)
(grid.FindControl("lstCountry")as DropDownList).SelectedValue = city.Country.ID.ToString(); <-- Here I got Exception
}
}
}
public static class EntityDataSourceExtensions {
public static TEntity GetItemObject<TEntity>(object dataItem) where TEntity : class {
var entity = dataItem as TEntity;
if(entity != null)
return entity;
var td = dataItem as System.ComponentModel.ICustomTypeDescriptor;
if(td != null)
return (TEntity)td.GetPropertyOwner(null);
return null;
}
}
C# Developer-- Modified Sunday, February 14, 2010 3:22 AM
modified on Sunday, February 14, 2010 3:39 AM
|
|
|
|
|
Please apply proper formating for your code before posting.
Developers generally hate to see the code without proper formatting and hence
your post might be ignored by a lot of members.
|
|
|
|
|
OK,ok, I've done it...
but nobody wantede help
C# Developer
|
|
|
|
|
Hi, I have a problem similar to this post:
http://www.microsoft.com.nsatc.net/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.office.developer.vba&tid=6fc07fd9-3313-4c09-9457-f6971ecafda4&cat=en_US_9477b478-d551-48fe-b931-e0d7ed05ac44&lang=en&cr=US&sloc=&p=1
In this post the original poster has written his code in VB whereas I have written my code in C#
My code for uploading a file:
protected void Button1_Click(object sender, EventArgs e)
{
if (FileUpload1.PostedFile.ContentLength>0)
{
string filename = Path.GetFileName(FileUpload1.PostedFile.FileName);
string storagepath = "D:\\Test\\" + filename;
int contentLen = FileUpload1.PostedFile.ContentLength;
Byte[] data = new Byte[contentLen];
FileUpload1.PostedFile.InputStream.Read(data, 0, contentLen);
savefiletodatabase(data);
FileUpload1.SaveAs(storagepath);
}
}
private void savefiletodatabase(byte[] data)
{
SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ToString());
try
{
SqlCommand command = new SqlCommand("INSERT into dbo.test ([file], [filename], [path]) VALUES (@data, '" + FileName + "', '" + FilePath + "')", connection);
command.Parameters.AddWithValue("data", data);
connection.Open();
command.Connection = connection;
command.ExecuteNonQuery();
}
catch (Exception ex)
{
throw ex;
}
finally { connection.Close(); }
}
The code to retrieve file goes here:
protected void LinkButton1_Click(object sender, EventArgs e)
{
getfile();
}
private void getfile()
{
SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ToString());
try
{
SqlCommand command = new SqlCommand("Select [file] FROM dbo.test where id='" + Id + "'", connection);
SqlDataReader reader;
connection.Open();
command.Connection = connection;
reader = command.ExecuteReader();
if (reader.Read())
{
byte[] data = (byte[])reader[0];
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Disposition", "attachment;filename=" + TextBox2.Text);
Context.Response.BinaryWrite(data);
}
}
catch (Exception ex)
{ throw ex; }
finally
{
connection.Close();
}
}
I am giving You the table structure here:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[test](
[file] [varbinary](max) NULL,
[filename] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[path] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[id] [int] IDENTITY(1,1) NOT NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
please help me out;
also when I uploaded a file to the database it was of 18041 bytes, but when I retrieved it after saving on desktop the size was 19,756 bytes which is increased?Thanks
Shankbond
|
|
|
|
|
shankbond wrote: also when I uploaded a file to the database it was of 18041 bytes, but when I retrieved it after saving on desktop the size was 19,756 bytes which is increased?
I think you need to clear the response using Response.Clear()
It's very important not to use string concatenation to make sql statements. Use parameterized queries instead.
|
|
|
|
|
Hi,
hspc wrote: I think you need to clear the response using Response.Clear()
I did but it does no effect on the size.Thanks
Shankbond
|
|
|
|
|
how to embed a 3rd party vedio conferencing software in asp.netcode?
is it possible in .net3.5?
can anybody suggest me any 3rd party tool for vedio conferencing?
plz its very urgent........
|
|
|
|