|
Here is the code to bind data to my datalist, that's all that related to the dataAdapter:
Dim myConnection as new OleDbConnection(ConfigurationSettings.AppSettings("connectionString"))
Dim dataAdapter as new OleDbDataAdapter("select * from Messages order by MessageID desc", myConnection)
Dim myDataSet as new DataSet
dataAdapter.Fill(myDataSet, "Messages")
Dim myTable as new DataTable
myTable = myDataSet.Tables("Messages")
DataList1.Datasource = myTable
Datalist1.DataBind()
Zeke
|
|
|
|
|
Hi!
Zek3vil wrote:
Dim myConnection as new OleDbConnection(ConfigurationSettings.AppSettings("connectionString"))
Could it be that your connection string, i.e. ConfigurationSettings.AppSettings("connectionString") contains an URL or something? Maybe this is not supported in a connection string? I once had a similiar exception with dataSet.WriteXml(URL) so maybe this is the problem..
Cheers
HTH
Martin
"Situation normal - all fu***d up"
Illuminatus!
|
|
|
|
|
Zek3vil wrote:
Dim myDataSet as new DataSet
dataAdapter.Fill(myDataSet, "Messages")
Dim myTable as new DataTable
myTable = myDataSet.Tables("Messages")
It seems a bit wrong way around
Try this:
Dim myDataSet as new DataSet
Dim myTable as new DataTable
myTable = myDataSet.Tables.Add("Messages")
dataAdapter.Fill(myDataSet, "Messages")
Hope this works, I use C# unfortunately, so I hope the VB is correct I see only C# shows up on MSDN (bug# 765176786 ).
Cheers
Give them a chance! Do it for the kittens, dear God, the kittens!
As seen on MS File Transfer: Please enter an integer between 1 and 2.
|
|
|
|
|
it doesnt work either, I found out that it's not the code that has problem but the connectionString
Thanks for helping
Zeke
|
|
|
|
|
I am working on a project that uses an apsx page as a search page. When the search is performed user controls are added to the page and data is populated accordingly. When a second search is done the user control needs to be cleared and repopulated accordingly. How do I go about clearing module level variables and the user control? Simply put my question is, how do I clear all the posted data?
Thanks in advance for any help you can provide.
Jason W.
|
|
|
|
|
Not something I've tried to do, but the thing that persists the data is ViewState. If its possible, it will be a member variable of the instantiated Page. The ViewState itself is an object of type StateBag which features a method called Clear which should empty it.
This should prevent the contents of any text boxes etc. being maintained. You'll have to put a call to this method based on some page event and which event you choose will be dependent upon when you want it cleared
Anyway, hope that helps, if I've completely misunderstood let me know and I'll give it another think.
--
Paul
"I need the secure packaging of Jockeys. My boys need a house!"
- Kramer, in "The Chinese Woman" episode of Seinfeld
MS Messenger: paul@oobaloo.co.uk
Sonork: 100.22446
|
|
|
|
|
Paul,
Thanks, I was going in the wrong direction trying to clean it up using the application object. The viewstate.clear() method does exactly what I want.
Jason
Jason W.
|
|
|
|
|
When I create a web service using vs.net.
The namespace's name seems fixed with the project' name.
So how to modify the namespace's name?should I have to do it manually(modify everywhere in the project the namespace appears)?
Another thing:the class name can be easily renamed using property.
Sorry if it seems so easy to some guys.
Thanks.
this is my signature for forums quoted from shog*9:
I can't help but feel, somewhere deep within that withered, bitter, scheming person, there is a small child, frightened, looking a way out.
|
|
|
|
|
本来我有和你一样的想法,就是一下子修改空间名;
以便在虚拟主机上能得到有效的应用。
但发现只要生成项目dll文件后将此文件移至空间根目录的/bin文件夹就可以实现很好的应用。
因此一直没有去对这些修改方式进行研究!
如有结果,烦请告知!
code@szweb.net
|
|
|
|
|
在这里看到中文,难得而且亲切。
我其实没有想到这么多,
vs.net我只是初学,有结果我一定通知你。
this is my signature for forums quoted from shog*9:
I can't help but feel, somewhere deep within that withered, bitter, scheming person, there is a small child, frightened, looking a way out.
|
|
|
|
|
zhoujun wrote:
在这里看到中文,难得而且亲切。
我其实没有想到这么多,
zhoujun wrote:
vs.net
zhoujun wrote:
我只是初学,有结果我一定通知你。
Cheers
Martin
"Situation normal - all fu***d up"
Illuminatus!
|
|
|
|
|
Hi,Martin.
Sorry for the inconvenience.
Csplanet use chinese in his posting,so I reply to him with chinese too.
We did not solve the problems.
What we are talking about is that he is also confused with my question,and want me to inform him if I get the answer.
And I reply to him that I will mail him as soon as I know.
That is all.
this is my signature for forums quoted from shog*9:
I can't help but feel, somewhere deep within that withered, bitter, scheming person, there is a small child, frightened, looking a way out.
|
|
|
|
|
The namespace for a dataset comes from the auto-generated code. You could, in theory, change the namespace by opening "DataSetName.cs" and editing it in there but it would almost certainly be overwritten every time you edit the dataset (because it regenerates the code).
There might be a better answer but I couldn't find it, so I resigned myself to the idea that I'm better off accepting the default namespace.
Paul
|
|
|
|
|
zhoujun wrote:
Sorry for the inconvenience.
It wasn't an inconvenience for me
It just looked a little peculiar to my untrained eyes
Cheers
Martin
"Situation normal - all fu***d up"
Illuminatus!
|
|
|
|
|
Sorry, me again
I think I found[^] the answer to the problem with cookie expiration although I didn't test it yet.
Cheers
Martin
"Situation normal - all fu***d up"
Illuminatus!
|
|
|
|
|
I will check it as soon as possible.
this is my signature for forums quoted from shog*9:
I can't help but feel, somewhere deep within that withered, bitter, scheming person, there is a small child, frightened, looking a way out.
|
|
|
|
|
Hi,
I know it quite simple but how can I declare constants that should be used in my all aspx application.
I think it should be in global.asax but I don't know how to code it.
Thx.
|
|
|
|
|
It's easiler to add a Module to your project called MyGlobals and add them all in there.
Paul
|
|
|
|
|
I wonder if I have write access on my server and have a page that makes it possible for other people to upload files and other stuff into an XML file, just something.
How can do so only my homepage can upload stuff.. and not You with this kinda code eg.:
Console.Write("\nPlease enter the URI to post data to : ");
String uriString = Console.ReadLine();
WebClient myWebClient = new WebClient();
Console.WriteLine("\nPlease enter the fully qualified path of the file to be uploaded to the URI");
string fileName = Console.ReadLine();
Console.WriteLine("Uploading {0} to {1} ...",fileName,uriString);
byte[] responseArray = myWebClient.UploadFile(uriString,fileName);
Console.WriteLine("\nResponse Received.The contents of the file uploaded are: \n{0}",Encoding.ASCII.GetString(responseArray));
It was taken from MSDN Library and what I've figured out is that this code can upload a file to any address, only if it has write access of course!? Am I right?
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
I have a datagrid containing an EditItemTemplate column.
The column contains a textbox and a customvalidator control. The ClientValidationFunction on the customvalidator is calling the javascript function correctly and I can check the value entered into the textbox ok, however if the validation fails I need to set the document focus back to the textbox 'tdValue'. Does anyone know how this can be done?
The 'source.controltovalidate' javascript property will return me a value in the form - controlname_dgDatagridName__ctl3_tdValue but I do not know how to use this name value to call the tdValue.focus() method.
Any suggestions?
<edititemtemplate>
<asp:textbox id="tdValue" runat="server" text="<%# DataBinder.Eval(Container.DataItem, "tdvalue", "{0 .00}") %>">
<asp:customvalidator id="validate_tdValue" enableclientscript="true" runat="server" controltovalidate="tdValue" errormessage="My Error" clientvalidationfunction="CheckCurrency">
function CheckCurrency(source, arguments)
{
//Do my validation here
alert(source.controltovalidate)
}
Thanks
It ain't what you know that matters.
Uncle Monkey
|
|
|
|
|
Whoops heres the edititemtemplate that was supposed to be in the last message :P
<edititemtemplate>
<asp:textbox id="tdValue" runat="server" text='<%# DataBinder.Eval(Container.DataItem, "tdvalue", "{0 .00}") %>' />
<asp:CustomValidator id="validate_tdValue" EnableClientScript="true" runat="server" ControlToValidate="tdValue" ErrorMessage="My Error" ClientValidationFunction="CheckCurrency" />
</edititemtemplate>
It ain't what you know that matters.
Uncle Monkey
|
|
|
|
|
I create a web service that return something like ramdom quotes,
But when I create an ASP.NET client web application to consume the web service and start the web app,
An error occurred,it said:
request because of status 401 failure:unauthorized.
And it red-colored my web method "this.Invoke("getquote",new object[0]).
What am I doing wrong?
Thanks in advance.
this is my signature for forums quoted from shog*9:
I can't help but feel, somewhere deep within that withered, bitter, scheming person, there is a small child, frightened, looking a way out.
|
|
|
|
|
Does this happen when running off your localhost?
Cheers,
Simon
"Sign up for a chance to be among the first to experience the wrath of the gods.", Microsoft's home page (24/06/2002)
|
|
|
|
|
Yes,Did you experience same problems ever?
this is my signature for forums quoted from shog*9:
I can't help but feel, somewhere deep within that withered, bitter, scheming person, there is a small child, frightened, looking a way out.
|
|
|
|
|
Hi,
I've developped a small application on my computer. All is working fine. I've generated an installable package for that aspx application.
I've installed the application on another computer and now I got some cast error.
I've a webform with textbox control. One textbox value is used as parameter in a function. I force this value to be converted as Decimal.
myObject.insertValue(CDec(txtBox1.text))
If I enter the value 123.4, I got a cast error and if I enter 123,4 it's working fine . But I don't want comma in my number.
Can some know where the problem is from ? I've check regional settings but it's seemd to be OK.
Thx
|
|
|
|