|
Hi, you can create a case in stored procedure. then use that stored as method to your DATAContextClass
Hope this one can help.
Thanks
Hi, Please select Good Question if my answer are fit to your Question.
|
|
|
|
|
|
Hi, create a stored procedure with your sql statement with CASE statement.
then after you saved the S.P. (stored procedure) drag it to your DATAContextClass.dhml
then you will see right side of the pane the name of your SP
then in your code behind call that SP
datacontextclass dc = new datacontextclass();
var q =
from a in convert.tostring(dc.nameofyourSP)
where a.columnfield == textbox1.text
grid1.datasource = q;
grid1.databind();
Hope this one can help.
Thanks
Hi, Please select Good Question if my answer are fit to your Question.
|
|
|
|
|
|
Hi, Thanks hope youve understand.
Hope this one can help.
Thanks
Hi, Please select Good Question if my answer are fit to your Question.
|
|
|
|
|
|
Hi all,
How i integrate the webcam in my web application iam working on attandance system for employees where i have to capture their phots during sign In and store inside database .
What are possible ways to integrate webcam any article or suggestion ?
Best Regards
Rameez
|
|
|
|
|
Hi,
Very good and interesting question. You have to use the ActiveX object of the WebCam driver. Please follow the link:
http://weblogs.asp.net/nleghari/articles/webcam.aspx
Either you love IT or leave IT...
|
|
|
|
|
Hi
I've added the global.aspx to website with code
void Application_Start(object sender, EventArgs e)
{
// Code that runs on application startup
Application["userCount"] = 0;
}
and
void Session_Start(object sender, EventArgs e)
{
// Code that runs when a new session is started
Application.Lock();
Application["userCount"] = (int)Application["userCount"] + 1;
Application.UnLock();
Label2.Text = Application["userCount"].ToString();
}
then to the page Default.aspx the label
</form>
<div>
<asp:Label ID="Label2" runat="server" Text=""></asp:Label>
</div>
</body>
and then getting errror
The name 'Label2' does not exist in the current context c:\WebSite1\Global.asax
I'm not sure what is wrong here. Please help?
|
|
|
|
|
It seems you need to get your hands on a basic ASP.NET book and read it. The error means what it says.
Christian Graus
Driven to the arms of OSX by Vista.
"I am new to programming world. I have been learning c# for about past four weeks. I am quite acquainted with the fundamentals of c#. Now I have to work on a project which converts given flat files to XML using the XML serialization method" - SK64 ( but the forums have stuff like this posted every day )
|
|
|
|
|
I don't think to be possible make reference to user control inside global.asax, use a webForm with a label to display the Application["userCount"] value.
|
|
|
|
|
Tnx Roclr
Unfortunately the book on ASP.NET that I hav didn't mention this bit of insight..
I really appreciate your help
|
|
|
|
|
Does the book you referred suggested that code you have shown? If so, you need to ditch it and find a better one.
|
|
|
|
|
The global asax is ok, just remove the reference to label2
In a webform use this code:
LabelName.Text = Application["userCount"].ToString();
Alexei Rodriguez
|
|
|
|
|
Hi,
I have a main page with an update panel and within it a wizard control.
The main page is assigned a Master page in which a script manager resides.
The wizard buttons are implemented as image buttons inside navigation templates and each of the 3 wizard steps is implemented by a dedicated user control.
On each step-control, I have several textboxes and dropdown lists. Some of the controls generate (Async) PostBack to the server.
The wizard navigation also generates AsyncPostBack since the whole wizard is inside the updatepanel.
The application was tested thoroughly and it causes no problems for clients with relatively good connection.
Alas when used by remote clients with slower connection (we assume this is the commonality between those reporting the error), the navigation between pages sometime shows the following error:
"Sys.WebForms.PagerequestManagerServerErrorException: An Unknown error occurred while processing the request on the server. The status code returned from the server was 500"
Please note: error was manifested only for some client, only some times and only in the navigation, not in the inter-step updates.
I have used fiddler and saw that the http response from the server is actually with status 200 but it contains the raw response text is something like "0|error|500||"
I tried to log errors on the ScriptManager.AsyncPostBackError event but it seems not to be called.
Any suggestions???
10x in advanced
|
|
|
|
|
Set ValidateRequest to "false" in your page directive.
Hope this will address your problem.
|
|
|
|
|
No, I am getting the same error even after setting validate =false.
Why this is occuring?
Can anyone please provide me a exact solution to solve this problem permenently?
Thanks in advance.
|
|
|
|
|
Hi,
I have a small form app that imports a image that a user browses to and adds the metadata to that image based on information provided in the form.
The process does work, it just doesn't write the description properties. It writes to the copywrite tag just fine, as well as create and transport the new image between servers.
Any help is always appreciated. The code that is supposed to write the metadata is:
if(this.sErrors == "") {
try {
ASCIIEncoding oEncoder = new ASCIIEncoding();
string sNewFile = Guid.NewGuid().ToString("D")+".jpg";
string sFile = Server.MapPath("tmp\\upload-"+sNewFile);
PropertyItem oProp;
PictureLocation.SaveAs(sFile);
Image imgUpload = Image.FromFile(sFile);
foreach(PropertyItem oProperty in imgUpload.PropertyItems) {
imgUpload.RemovePropertyItem(oProperty.Id);
}
oProp = CreatePropertyItem(0x0320, PictureCaption.Text);
imgUpload.SetPropertyItem(oProp);
oProp = CreatePropertyItem(0x013B, FirstName.Text+" "+LastName.Text+" ("+EMail.Text+")");
imgUpload.SetPropertyItem(oProp);
oProp = CreatePropertyItem(0x8298, Address.Text + ", " + City.Text + ", " + State.Text + " " + ZipCode.Text);
imgUpload.SetPropertyItem(oProp);
oProp = CreatePropertyItem(0x010E, WhatKindOfFun.Value);
imgUpload.SetPropertyItem(oProp);
imgUpload.Save(Server.MapPath("tmp\\process-"+sNewFile));
imgUpload.Dispose();
DateTime oDate = DateTime.Now;
this.CreateFTPDirectory("ftp://64.179.77.44/"+Convert.ToString(oDate.Year)+"/");
this.CreateFTPDirectory("ftp://64.179.77.44/"+Convert.ToString(oDate.Year)+"/"+Convert.ToString(oDate.Month)+"/");
this.CreateFTPDirectory("ftp://64.179.77.44/"+Convert.ToString(oDate.Year)+"/"+Convert.ToString(oDate.Month)+"/"+Convert.ToString(oDate.Day)+"/");
FtpWebRequest oFTP = (FtpWebRequest)FtpWebRequest.Create("ftp://64.179.77.44/"+Convert.ToString(oDate.Year)+"/"+Convert.ToString(oDate.Month)+"/"+Convert.ToString(oDate.Day)+"/"+sNewFile);
oFTP.Method = WebRequestMethods.Ftp.UploadFile;
oFTP.Credentials = this.oCred;
oFTP.UsePassive = true;
oFTP.UseBinary = true;
oFTP.KeepAlive = false;
FileStream oFile = File.OpenRead(Server.MapPath("tmp\\process-"+sNewFile));
byte[] oBuffer = new byte[oFile.Length];
oFile.Read(oBuffer, 0, oBuffer.Length);
oFile.Close();
Stream oStream = oFTP.GetRequestStream();
oStream.Write(oBuffer, 0, oBuffer.Length);
oStream.Close();
Response.Redirect("The site it goes to");
} catch {
}
}
|
|
|
|
|
On the page load event i have coded this:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
TextBox1.Attributes.Add("onblur", "return myfunc()")
End Sub
Public Sub myfunc()
Dim dataset1 as new dataset
Dim da as new dataadapter
..
..
TextBox1.Text = "This is lostfocus."
End Sub
but it is not working. In the myfunc() i would like to code connection string, data adapter and dataset to go further.
Kindly tell me how call a function/procedure which is wirtten in file.aspx.vb on lost focus of textbox.
Thanks & Regards
Girish Sharma
|
|
|
|
|
You're trying to call a server side event with client script by the looks of it. Try learning about Ajax.
|
|
|
|
|
Hi, to call function, first the function must be public if you want to use it to other project or webform.
About your Code to call the procedure myfunc()
example in your button1 click event you can insert
button1_click()
{
myfunc();
}
Hope this one can help.
Thanks
Hi, Please select Good Question if my answer are fit to your Question.
|
|
|
|
|
use this code:
Protected Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
myfunc()
End Sub
Remove the code in you page load and set the textbox autopostback = true
Alexei Rodriguez
|
|
|
|
|
Your solution worked for me.
Thank you Alexei Rodriguez!!!
Regards
Girish Sharma
|
|
|
|
|
Hi,
Iam srikanth a 4 + years .Net developer. I have a Dotnet interview focusing more on asp.net and xml. could anyone plz suggest some important questions on asp.net. mostly what would the project manager would concentrate on real time scenarious. i would be thankfull for the members in this site who give me giudence.
With regards
Srikanth
|
|
|
|
|