|
HI,
R u getting runtime error or compiletime error?
Thanks and Regards,
Chetan Ranpariya
|
|
|
|
|
hi
Iam getting compile time error
|
|
|
|
|
Hi friend sorry but i never got this type of error while connection string
you r doing right.
I just thinking where you done this coding is it in the class or out of class method??
May be that's only problem..
Sorry for this..
|
|
|
|
|
static string conn="provider=microsoft.jet.oledb.4.0;data Source="+ Server.MapPath("/data/db1.mdb");
OleDbConnection cn=new OleDbConnection(conn);
please help me, where did i make wrong in the above instructions and please solve this.
it show error that:'System.Web.UI.Page.Server' denotes a 'property' where a 'class' was expected
www.mywebsite.com/data/db1.mdb
how to access the db1.mdb file using Asp.NET using c# please help me i will be thank full to you.
please answer me with above example
multimedia9
|
|
|
|
|
|
Hi frnd
Thank u
They hav given the general connection strings,
these are used to connect to local host, but i need to connect to webserver.
if you reply with appr answer i will be very happy, & please try to know the answer by asking ur colleagues.
i will be thank ful to you if you consider this request.
multimedia9
|
|
|
|
|
Hi
1. After deploying your web application in server and link will be like: http://10.57.89.15/TestWebApplication/page.aspx
2. The Virtual directory (i.e 'TestWebApplication' as in the above code) you created in server can be modified using Web.Config. Add a key and value to store virtual directory name. Use this key in your code-behind file. ConfigurationSettings.AppSettings
3. If your .mdb file is in sub-folder of your web app i.e., in App_Data. Then that file can be accessed using the foll. code
<br />
string StrDataSource = Server.MapPath("\\TestWebApplication\\App_Data\\db1.mdb");<br />
Hope you got it.
Harini
|
|
|
|
|
hi
thank u
string StrDataSource = Server.MapPath("\\TestWebApplication\\App_Data\\db1.mdb");
this instruction gives an error that " 'System.Web.UI.Page.Server' denotes a 'property' where a 'class' was expected ".
Please solve this problem.
thank u
|
|
|
|
|
Hi
It was working fine for me when I give Server.MapPath.
Try change Server.MapPath to HttpContext.Current.Server.MapPath
Harini
|
|
|
|
|
ya
its working
thank u very very much for avoiding such error, by using HTTP.........
could u plz help me in another prob
My website contains
1)let me take my website ftp address 10.29.398.456 & http address www.mydomain.com
2)under which
/db /logs /wwwroot folders are there
3)under /wwwroot
/data /mail and some other folders
4)under /data
/db1.mdb is there
by using above example
please write
configurationSettings & connection string
bcoz even though it not showing error it shows error at runtime
thank u very much, I hope u will reply for this.
multimedia9
|
|
|
|
|
I'm just starting to get into ASP.net, so forgive my noob-ness. Normally, I use straight C# for client apps.
I have a little project I'm trying to start, but things aren't working right (even with VisualStudio).
What I want to do is this:
- a client C# app sends a string to an aspx page
- the aspx page sends the string to a server-side C# file
- the server-side cs file processes the string and sends back a string to the aspx file
- the aspx file sends the processed string to the client C# app
I have to have the server-side C# file because it won't let me use some Windows.Forms objects in just an aspx file.
Where do I start at accomplishing this?
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
I think you want to pass some string to the server and process it there and return to the client app ? If so no need to do like this. You can go for webservices. Create a webservice that accepts this string value. Do the processing inside the webservice method and return the answer.
Heritos Gger wrote: the aspx page sends the string to a server-side C# file
- the server-side cs file processes the string and sends back a string to the aspx file
When an aspx file is loaded, I think it will call cs file automatically. I am not getting what do you mean by sending string to a server side c# file ?
|
|
|
|
|
When I use VisualStudio, I add a class to the website project. It adds a cs file to an App_Code folder (or something similar).
You think I should use a webservice instead? I'll look into it. Thanks for the info!
Basically, the client app should pass a string to the server, and the server should process it and return another string. That's basically it (and I don't know how to do it). The whole thing about an aspx file and a cs file is from what I was able to figure out by myself. If there's a better way, I'm more than willing to give it a try.
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
How add web control for printing ?
How Creare MessageBox for warning?
-- modified at 23:21 Wednesday 6th June, 2007
|
|
|
|
|
wongeva wrote: How Creare MessageBox for warning?
Do you mean alert("Message") in javascript ?
|
|
|
|
|
<asp:datalist id="DataList1" runat="server" datakeyfield="ProductID"
="" datasourceid="ObjectDataSource1" enableviewstate="False">
If there are 3 attributes key serve as the table's primary key. How can i put the DataKeyField with 3 attributes name?
Who can help me?.......please
THANKS
|
|
|
|
|
I have a question regarding the use of GridView or any other server controls that allows be to display and format data in the following manner?
row01 | row04 | row07
row02 | row05 | row08
row03 | row06 | row09
Possibly this is page 1 and page 2 will look like something...
row10 | row13 | row16
row11 | row14 | row17
row12 | row15 | row18
And so on...
The objective of doing this is because I want to maximize the use of the space on the right hand side if each record in the database I want to display is somewhat
short rather than using the default rendering behaviour that grows downwards after each record is displayed per line.
Is this doable using GridView, if yes can anyone advise me on how I should go about doing it or examples, tutorials I can be referred to. Or I have to use some other web control other than GridView? Repeater?
Thanks in advance.
|
|
|
|
|
I'd expect to use a repeater to define a layout like this. It's more flexible, the gridview is more powerful when you want one row per record.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi
You can use DataList Server Control. You can set direction or no. of columns to display using the attribute RepeatDirection or RepeatColumns. Both are optional.
For eg.,
<code><asp:DataList id="DataList1" runat="server" RepeatDirection="Horizontal">
<ItemTemplate>
<table border=1>
<tr>
<td>
<%# DataBinder.Eval(Container.DataItem, "Au_ID") %>
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
</code>
Or, Check this link <a href="http://msdn2.microsoft.com/en-us/library/yfx4t9t7(VS.71).aspx">DataList Web Server Control</a>[<a href="http://msdn2.microsoft.com/en-us/library/yfx4t9t7(VS.71).aspx" target="_blank" title="New Window">^</a>]
Hope you got it.
Harini
|
|
|
|
|
hello everyone, sorry so long
ive got an entry form that users are allowed to post to a log with. the form contains a datalist of checkboxes that are flags to filter by. when a user clicks certain checkboxes a radiobuttonlist showing parameters is displayed within the item. the problem occuring on postback is that the checkboxes and radios go back to there original state and i would lose files added to the listbox from the previous post back. In order to get around this i create a session value of a small structure that i use as a basic entry template. the structure contains 2 string collections that are related to files and flags.
this method seems to work exactly as expected for the listbox control but i dont seem to be getting any of the values from my datalist added to the session value ie the flag collection retruns a count of zero.
here is where im adding the values from files and from flags
the for loop is the problem i suppose as the values for the file collection appear but none from the datalist
<br />
'skipping the bulk<br />
Dim str As String = ""<br />
str = smf.location0 & ","<br />
str &= smf.name1 & ","<br />
str &= smf.caption2 & ","<br />
str &= smf.type3 & ","<br />
str &= smf.id4.ToString<br />
smsg.StrFileCol.Add(str)<br />
Me.lblFileStatus.Text = "File added as " & smf.name1<br />
<br />
<br />
For Each itm As DataListItem In Me.dlFlags.Items<br />
Dim chkbx As CheckBox = CType(itm.FindControl("chkFlag"), CheckBox)<br />
Dim hdn As HiddenField = CType(itm.FindControl("hdnFlagId"), HiddenField)<br />
<br />
Dim rdos As RadioButtonList = CType(itm.FindControl("rdoparam"), RadioButtonList)<br />
Dim flgstr As String = ""<br />
If chkbx.Checked = True Then<br />
If Not (rdos.SelectedValue =-1) Then<br />
flgstr = hdn.Value & ","<br />
flgstr &= rdos.SelectedValue<br />
Else<br />
flgstr = hdn.Value & ","<br />
flgstr &= 0<br />
End If<br />
smsg.StrFlagCol.Add(flgstr)<br />
End If<br />
Next<br />
Session("smsg") = smsg<br />
'also trying Session.Item("smsg") = smsg but they seem equivalent<br />
End If<br />
<br />
<br />
Dim tempStr2 As String() = Split(gid, "-")<br />
If tempStr2.Length = 5 Then<br />
Me.lboxFileUpload.Items.Insert(0, litm)<br />
Else<br />
Me.lblFileStatus.Text = "Error Adding " & gid<br />
End If<br />
Else<br />
Me.lblFileStatus.Text = "Please specify a title"<br />
End If
i'm attempting to display this two different ways
the most obvious i thought would be
Protected Sub dlFlags_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataListItemEventArgs) Handles dlFlags.ItemDataBound<br />
<br />
Dim chk As CheckBox = CType(e.Item.FindControl("chkFlag"), CheckBox)<br />
Dim xDs As XmlDataSource = xmldsflagparams<br />
Dim hdn As HiddenField = CType(e.Item.FindControl("hdnFlagId"), HiddenField)<br />
Dim rdo As RadioButtonList = CType(e.Item.FindControl("rdoparam"), RadioButtonList)<br />
xDs.XPath = "//flag[@id='" & hdn.Value & "']//param"<br />
rdo.DataSourceID = ""<br />
rdo.DataSource = xDs<br />
rdo.DataBind()<br />
Dim spn As HtmlGenericControl = CType(e.Item.FindControl("radiolist"), HtmlGenericControl)<br />
For Each flag As String In smsg.StrFlagCol<br />
Dim strflag() As String = Split(flag, ",")<br />
If strflag(0) = hdn.Value Then<br />
chk.Checked = True<br />
End If<br />
If strflag(1) > 0 Then<br />
rdo.SelectedValue = strflag(1)<br />
spn.Style.Item("display") = "inline"<br />
End If<br />
Next<br />
Dim lbl As New Label<br />
'this always returns 0<br />
lbl.Text = smsg.StrFlagCol.Count<br />
e.Item.Controls.Add(lbl)<br />
End Sub
I would greatly appreciate any insight on this
werD, MCP
-- modified at 20:16 Wednesday 6th June, 2007
|
|
|
|
|
Odds are you bind to your data source in page load on postback ( sorry, this was too long for me to read it all ). this rests the control state and your viewstate is lost.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thanks for you response
i got to trying this and it when i dont call databind on the datalist when its a postback it disappears. why is this? ive been binding and then trying to set these values checked or not with a session variable, but if this would work without that overhead i would be thrilled
werD, MCP
|
|
|
|
|
Hi all,
I have been searching for two weeks till now for any code or idea about how to download a CSV file that is online to a web page. I need to download the CSV file under finance.yahoo.com for any stock to an HTML page. I have been trying to find what is the best way to do that. Please help me and let me know if you have any ideas or if you can help me.
Thanks!
Best regards and many thanks
|
|
|
|
|
Which bit are you stuck with ? You need to download the file, and then parse it to build your table.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Well, that's a good question. I am stuck with opening the file to html page. Thanks for getting back so quickly. I appreciate your help.
Best regards and many thanks
|
|
|
|