|
HI
THX For Reply
I got it
THX
asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf
|
|
|
|
|
hi
iam storing binary format of the images in db.Now i want to display them on my page with other details.Actually my db table contains many fields .on datagrid iam displaying twofields like eno,ename...and i have taken two link buttons (view and modify)view is to view the full details of the particular employee.when the user click the view link the details will be shown in new seperate window(target=_blank).here my image are displaying properly for all the records.My problem is with modify link.when user click the modify link iam displaying all the details for modification in nxtpage(target=_self). .here my image is not displaying properly.first time for accessing the record it is displaying the image properly.if i am going for another record for modification it is showing only the previous image.if iam refreshing the page then only it is showing the particular image properly how to rectify this problem.whether i have to clean browser cache for every request.If yes how?
// here is my code
private void Page_Load(object sender, System.EventArgs e)
{
int Eno;
Eno = int.Parse(Request.QueryString.Get("eno"));
try
{
if (!Page.IsPostBack)
{
SqlConnection conn = new SqlConnection(ConfigurationSettings.AppSettings["strConn"]);
SqlCommand cmd = new SqlCommand("select ENO,ENAME,GENDER,EDOB,EAGE,EDOJ,ESALARY,EPHONE,EADDR,EPHOTO from register where ENO="+ Eno +"",conn);
SqlDataReader dr;
conn.Open();
dr = cmd.ExecuteReader();
dr.Read();
Employno1.Text = dr[0].ToString();
Employname1.Text = dr[1].ToString();
string Gendervalue = dr[2].ToString();
Gendervalue=Gendervalue.TrimEnd();
//Response.Write("|" + Gendervalue + "|");
if (Gendervalue.Equals("male"))
{
RadioButton1.Checked = true;
RadioButton2.Checked = false;
}
else
{
RadioButton2.Checked = true;
RadioButton1.Checked = false;
}
//string exdate = dr[3].ToString();
Employdob1.Text = dr[3].ToString();
Employage1.Text = dr[4].ToString();
Employdoj1.Text = dr[5].ToString();
Employsalary1.Text = dr[6].ToString();
Employphno1.Text = dr[7].ToString();
Employaddress1.Text = dr[8].ToString();
// Create a new stream to load this photo into
FileStream stream = new FileStream("c:/inetpub/wwwroot/Project1/personimage2.bmp",FileMode.OpenOrCreate,FileAccess.Write);
BinaryWriter bw = new BinaryWriter(stream);
byte[] buffer = new byte[stream.Length];
buffer = (byte[])dr[9];
bw.Write(buffer);
bw.Close();
stream.Close();
Image1.ImageUrl="http://new4/Project1/personimage2.bmp";
dr.Close();
conn.Close();
}
}
catch(Exception ex)
{
Response.Write(ex.Message);
}
}
thanks
vijay
|
|
|
|
|
hi
may ur problem solve tht link so use and get
http://www.programmingknowledge.com/ImageUpload.aspx
use
to show image on page
Response.BinaryWrite(imageData);
dcjoshi2
|
|
|
|
|
Does anyone know if there is a .net version of PHPMyAdmin but more for MS SQL databases ?
Basically I'm looking for an open-source web-based database management tool.
|
|
|
|
|
|
Check the Sql Server Management Studio Express
keep Learning and you never will be out of date...
|
|
|
|
|
Hello,
In my GridView I have a HyperLink Field where I set the DataNavigateUrlFormaString
MyHyperLinkField.DataNavigateUrlFormatString = "~\RSS.ashx?Channel={0}&Culture=" & System.Threading.Thread.CurrentThread.CurrentCulture.ToString()
I believe {0} retrieves the value of my datasource column with index 0. That value is "News".
What I get when I copy the link when previewing the page is:
http://localhost:1717/JaquelineRoxoAtelier%202006a/RSS.ashx?c=News
The part "http://localhost:1717/JaquelineRoxoAtelier%202006a/" is the web site url in my localhost but then I can't see the culture value and everything else is strange.
In my GridView all the QueryStrings I am building look strange and don't work.
Could somebody help me out?
Thanks,
Miguel
|
|
|
|
|
Hello,
Could someone help me out with this?
My QueryStrings are getting all messed up.
I created the GridView at runtime. I am posting my entire code with **** in the code lines which I think are giving me the problem.
Could somebody help me out with this? I tried everything I could think off.
Private Sub gvRSSChannels_Init(ByVal sender As Object, ByVal e As EventArgs) Handles gvRSSChannels.Init
' Define gvRSSChannels properties
With gvRSSChannels
.AutoGenerateColumns = False
.BorderStyle = BorderStyle.None
.DataSource = gvRSSChannels_DataSource()
.GridLines = GridLines.Horizontal
.ShowFooter = False
.ShowHeader = False
End With
' Create, define and add icon template field
Dim tfIcon As New TemplateField
tfIcon.ItemTemplate = New gvRSSChannelsTemplate(Me, ListItemType.Item)
gvRSSChannels.Columns.Add(tfIcon)
' Create, define and add name bound field
Dim bfName As New BoundField
With bfName
.DataField = "Channel"
End With
gvRSSChannels.Columns.Add(bfName)
' Create, define and add url hyperlink field
Dim hfUrl As New HyperLinkField
With hfUrl
.DataTextFormatString = "Me.GetLocalResourceObject(""String.{0}"").ToString()"
.DataNavigateUrlFormatString = "~\RSS.ashx?Channel={0}&Culture=" & System.Threading.Thread.CurrentThread.CurrentCulture.ToString() ' ****
End With
gvRSSChannels.Columns.Add(hfUrl)
End Sub
Private Sub gvRSSChannels_Load(ByVal sender As Object, ByVal e As EventArgs) Handles gvRSSChannels.Load
' Bind GridView to its data source
If Not IsPostBack Then
gvRSSChannels.DataBind()
End If
End Sub
---- Template CLASS ----
' rRSSChannelsTemplate
Public Class gvRSSChannelsTemplate
Implements ITemplate
' Define parent page
Private parent As RSS
' Define template type
Private type As ListItemType
' Create new template
Sub New(ByVal parentPage As RSS, ByVal templateType As ListItemType)
' Define parent page
parent = parentPage
' Define template type
type = templateType
End Sub
' Define template
Sub InstantiateIn(ByVal container As Control) Implements ITemplate.InstantiateIn
' Select template type
Select Case type
Case ListItemType.Header ' Header template
Case ListItemType.Item ' Item template
' Create item template controls
Dim rtrhlIcon As New RssToolkit.RssHyperLink
' Add item template controls handlers
AddHandler rtrhlIcon.DataBinding, AddressOf rtrhlIcon_DataBinding
' Add item template controls to gvRSSChannels
container.Controls.Add(rtrhlIcon)
Case ListItemType.EditItem ' Edit Item template
Case ListItemType.Footer ' Footer template
End Select
End Sub
' rtrhlIcon data binding and properties
Private Sub rtrhlIcon_DataBinding(ByVal sender As Object, ByVal e As System.EventArgs)
' Define rtrhlIcon
Dim rtrhlIcon As RssToolkit.RssHyperLink
rtrhlIcon = CType(sender, RssToolkit.RssHyperLink)
' Define rtrhlIcon container
Dim container As GridViewRow
container = CType(rtrhlIcon.NamingContainer, GridViewRow)
' Define rtrhlIcon properties
With rtrhlIcon
.ChannelName = Me.parent.GetLocalResourceObject("String." & DataBinder.Eval(container.DataItem, "Channel")).ToString() ' ****
.ImageUrl = Me.parent.GetLocalResourceObject("rtrhlIcon.ImageUrl").ToString()
.IncludeUserName = "False"
.NavigateUrl = "~/RSS.ashx?Channel=" & DataBinder.Eval(container.DataItem, "Channel") & _
"&Culture=" & System.Threading.Thread.CurrentThread.CurrentCulture.ToString())
.ToolTip = Me.parent.GetLocalResourceObject("String." & DataBinder.Eval(container.DataItem, "Channel")).ToString() ' ****
End With
End Sub
End Class
Thank You Very Much,
Miguel
|
|
|
|
|
I have a dataset which gets a lot of configuration and client specific data from a XML file. This dataset needs to be used across the whole web application, but the data in the dataset will not be changed by the app. I am looking at the various ways of doing it, but cannot decide. I need to keep performance in mind since our clients are growing. What is the best way to do it? Global assembly cache? application cache? I think application cache has big impact on performance? any other ways?
|
|
|
|
|
As the data isn't changing, I would think the Application cache would be fine.
|
|
|
|
|
Try a session dataset var, it works for me
keep Learning and you never will be out of date...
|
|
|
|
|
hi guys i have a simple asp.net website which is linked to an mc sql database
so far when i tested it on my computer it works how ever when i try to put the files inside the web hosting the connection between the 2 dont seems to be working.
this lead me to thinking i need to put some kinda connection between the database and the main web.
could any one pls tell me the procedure that i have to do from testing from vb.net to a real web host.
|
|
|
|
|
It depends a lot on your host, doesn't it?
I'm guessing you are using Sql 2005 Express for development? Check with your host - they may have utilities to upsize an Express database to a bonafide Sql Server 2005 installation.
|
|
|
|
|
well you see.
i heard that i had to change my connection string and stuff in all my files(not sure)
change my web.config connection string.(not sure)
this are the 2 procedure i heard that i need to do
however after i done this 2 my web site still look like this =P
www.duoultra.com/miratech
|
|
|
|
|
And what does your host say about this?
|
|
|
|
|
Pasting the connection string is not enough, you must also call the connection string from places to activate the string.
Are you calling the connection string anywhere? If so, please check the script on that side. There are also many online tutorial available on ASP .NET.
Since we did not write the script for you, it is impossible for us to go through the script and find out what is wrong with it. The error you are getting now
is because you have not called the connection string anywhere in your script.
|
|
|
|
|
I guess the original point I wanted to get to was in what medium was your data stored. What are you using in your development environment? Is it Sql Express? Is it full Sql Server?
If it is Sql Express, you are most likely not going to be able to simply copy the .mdf file and expect it to work (even with connection strings pointed correctly). It is likely that your host does not support Sql Express and would not have the necessary services running on their servers for Express to work. That's why I originally said to check with your host.
Typically, a host will support a full Sql Server edition (not the Express edition). In this case, assuming you've purchased Sql Server hosting as part of your plan, you would need to upload the data from your Express file to the host's Sql Server database. Again, I would check with your host on this. It is possible that they have tools to help with this kind of [Express->to->SqlServer] upload.
Once you have the data loaded in the format expected by your host, then you would look to modify connection strings in your application (hopefully you're using the <connectionStrings> web.config section for this) to properly point to the host's database.
|
|
|
|
|
they also replyed me this
Hi:
Thank you for contacting us. The following script is a sample code in web.config file:
<connectionstrings>
<add name="SiteSqlServer" connectionstring="Server=dedicated;Database=DotNetNuke;uid=USERNAME;pwd=PASSWORD;" providername="System.Data.SqlClient">
After this is entered in your connection string, you need to call "SiteSQLServer" to activate the connection string.
Thanks
i would like to know the if the connection string part is to be inputed inside <system.web>or outside.
also any one know how can i call "SiteSQLServer" to activate the connection string.
like how am i supposs do this (maybe a sample?)
|
|
|
|
|
guys help me see if my logic is correct pls:
the web.config connection string is to access the database server.
the connection string in the script is to access the database.
|
|
|
|
|
Hi,
I have to update a dataset. Grid shows in this format and hence Dataset is in this format
10 100
8 70
9 30
when update is done to this, it is such that proc calculates 10 based on 8 and 9 (70+30 =100). the update call is given to sqlhelper class and hence 10 goes I and then 8,9
I need to alter this sort.
Am now going to Dataview for this.
DataView dv = new DataView(ds.Tables[0]);
//apply a sort
dv.Sort = "Lastname Desc";
1.now i need to assign dv back to ds. How do I do it?
Can you help me?
rmr
|
|
|
|
|
Hi,
When my page is in it's Page_Load method (in my code behind file) I need to get inner HTML of a certain element. Actually I need the HTML that my repeater control produces and then save it to a string.
How can I do this? Is the HTML even generated yet at the point in time when Page_Load is called? If not, I can wait 'till anytime in execution, I just need to get the HTML of the repeater control into a string in my code behind file.
/\ |_ E X E GG
|
|
|
|
|
figured it out. I just added a flag to my method that builds the
repeater and added this code to the bottom of that method:
if (render)
{
StringBuilder sb= new StringBuilder();
StringWriter sw= new StringWriter(sb);
HtmlTextWriter hw= new
HtmlTextWriter(sw);
RepeaterPapers.RenderControl(hw);
return sb.ToString();
}
So if render is true, it will return immediately with the html of the
repeater!
/\ |_ E X E GG
|
|
|
|
|
hi to all
I have datagrid with 9 records.i have 3 buttons named as ,view all ,Active,Deactive.
Here my database columns are country,company,logo,status.
If i click view all the records can be viewed pagewise without any error. It is working fine.
The other 2 buttons namely:
Button Active-status is 1
Button DeActive-staus is 0
I have set pagesize= 5 , that is i have 5 records(1,2,3,4,5) in the first page,4 records(6,7,8,9) in second page.
In the first page i have 3 active records (1,3,5), and two deactive records(2,4)
if i click active in the first page only 3 active(1,3,5) should be displayed and if i click deactive only two deactive records (2,4) should be displayed. Instead all the active records(including active records in second page) are also displaying in that page and same problem in deactive also.
similarly,
In the second page i have two actve records (7,9), and two deactive records(6,8)
if i click active in the second page only 2 active(7,9) should be displayed and if i click deactive only two deactive records (6,8) should be displayed. Instead all the active records(including active records in first page) are also displaying in that page and same problem in deactive also.
My question is i have to display only the active records in the first page.I have set overall pagesize as 5 in my datagrid. How can i set to display only the 3 active records and two deactive records in the first page and same for second page .
I have given the code for Active & Deactive below
ACTIVE BUTTON: (status 1)
Try
strConnString = objCsLgateway.GetConnectionString()
conn = objCsDataBase.GetDbConnection(strConnString)
Dim adap As New SqlDataAdapter("select DISTINCT logo_code,company_name,country_name,category,picture_path from tblLogos where status=1 ", conn)
Dim ds As New DataSet
adap.Fill(ds, "tblLogos")
DataGrid1.CurrentPageIndex = 0
DataGrid1.DataSource = ds
DataGrid1.DataBind()
Catch errEx As Exception
Response.Write(errEx.Message)
End Try
DEACTIVE BUTTON (status 0)
Try
strConnString = objCsLgateway.GetConnectionString()
conn = objCsDataBase.GetDbConnection(strConnString)
Dim adap As New SqlDataAdapter("select DISTINCT logo_code,company_name,country_name,category,picture_path from tblLogos where status=0 ", conn)
Dim ds As New DataSet
adap.Fill(ds, "tblLogos")
DataGrid1.CurrentPageIndex = 0
DataGrid1.DataSource = ds
DataGrid1.DataBind()
Catch errEx As Exception
Response.Write(errEx.Message)
End Try
plz provide me with proper solution and the corrected code.
|
|
|
|
|
|
Hi All,
I have registered javascript function form Page_Load method in my User control.
Is there any way to tell web page which my control belongs to to call this function from body onload event ? I do not have access to the web page and would like to do it from user control.
Thank you very much
Roman
|
|
|
|
|