hi,
im trying to create a simple database with Atlas, everything seems ok, I enabled page editing so user(s) can edit on the fly but when you click edit, on the chosen field, and then click update it comes back with an error that I will paste below. There are four colums
[Complaint Details] [Name] [Complete] [Date (dd/mm/yyyy)].
I would really appreciate some help, thanks so much..
Server Error in '/final' Application.
--------------------------------------------------------------------------------ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'Update' that has parameters: Complaint_Details, Name, Complete, p1, original_TaskId, Complaint Details, Date (dd/mm/yyyy).
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'Update' that has parameters: Complaint_Details, Name, Complete, p1, original_TaskId, Complaint Details, Date (dd/mm/yyyy).
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[InvalidOperationException: ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'Update' that has parameters: Complaint_Details, Name, Complete, p1, original_TaskId, Complaint Details, Date (dd/mm/yyyy).]
System.Web.UI.WebControls.ObjectDataSourceView.GetResolvedMethodData(Type type, String methodName, IDictionary allParameters, DataSourceOperation operation) +1129
System.Web.UI.WebControls.ObjectDataSourceView.ExecuteUpdate(IDictionary keys, IDictionary values, IDictionary oldValues) +2254
System.Web.UI.DataSourceView.Update(IDictionary keys, IDictionary values, IDictionary oldValues, DataSourceViewOperationCallback callback) +78
System.Web.UI.WebControls.GridView.HandleUpdate(GridViewRow row, Int32 rowIndex, Boolean causesValidation) +1218
System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +853
System.Web.UI.WebControls.GridView.OnBubbleEvent(Object source, EventArgs e) +87
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
System.Web.UI.WebControls.GridViewRow.OnBubbleEvent(Object source, EventArgs e) +117
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +35
System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +86
System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +153
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +172
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4921
asp.net - atlas
How can I re-use an object created in designer?
Ok say I have one form where I create some DataSet (in the visual editor, so it appears at the bottom). Now I want to re-use that exact same instance in a different control, so that I can see it in the visual editor as well (so I can easily bind it to any properties).How can I achieve that?Biggest problem is that I can't figure out a way to prevent VS2005 from instantiating any objects you create in the visual editor, so 2 DataSets = two separate instances. Any suggestions? Or am I gonna have to bind ever freaking control by hand?
How to share along several projects
Hi all, My question is simple to ask, but I am absolutely lost: I have a solution with several projects; each project is designed to be build into a standalone webapp. How can I share CSS, App_themes & master templates between projects to avoid maintaining copies of these folders???
Thnkx very much!
How to Decode a base64 encoded string in C#
The following code sample shows how to Decode a base64 encoded string in C#
public string base64Decode(string data)
{
try {
System.Text.UTF8Encoding encoder = new System.Text.UTF8Encoding();
System.Text.Decoder utf8Decode = encoder.GetDecoder();
byte[] bt= Convert.FromBase64String(data);
int charCount = utf8Decode.GetCharCount(bt, 0, bt.Length);
char[] ch = new char[charCount];
utf8Decode.GetChars(bt, 0, bt.Length, ch , 0);
string result = new String(ch );
return result;
}
catch(Exception e)
{
throw new Exception("Error in base64Decode" + e.Message);
}
}
Parse QueryString Values into Dataset
The following code sample shows how to parse QueryString Values into Dataset
//declaring a string array
string[] strArrQuerystring;
strArrQuerystring=new string[Request.QueryString.AllKeys.Length];
//getting the query string values into string array
for (int i = 0; i <>
{
strArrQuerystring[i] = Request.QueryString.Keys[i].ToUpper() + "," + Request.QueryString.GetValues(i)[0].ToString();
}
//getting the query string values into dataset
DataSet dsQueryString =QueryStringParser(strArrQuerystring);
public DataSet QueryStringParser(string[] strArrayQueryString)
{
DataSet dsInputs = new DataSet();
DataTable dtInputs = new DataTable();
DataColumn dcColumn = null;
for (int i = 0; i <>
{
dcColumn = new DataColumn(strArrayQueryString[i].Split(',')[0].ToUpper());
dtInputs.Columns.Add(dcColumn);
}
DataRow drInputs = dtInputs.NewRow();
for (int j = 0; j <>
{
drInputs[j] = strArrayQueryString[j].Split(',')[1].ToString();
}
dtInputs.Rows.Add(drInputs);
dsInputs.Tables.Add(dtInputs);
return dsInputs;
}
How to get the Last day of month
Dim currentDate As DateTime = DateTime.Now.Date
Dim sDate As DateTime = currentDate.Subtract(New TimeSpan(currentDate.Day - 1, 0, 0, 0, 0)).ToShortDateString()
Dim EndDate As String=sDate.Add(New TimeSpan(DateTime.Now.DaysInMonth(DateTime.Now.Year, DateTime.Now.Month)-1, 0, 0, 0, 0)).ToShortDateString()
Public Function ComputeLastDayOfMonth(ByVal TheDate As Variant) As Integer
LastDayOfMonth = DatePart("d", DateAdd("d", -1, DateAdd("m", 1, DateAdd("d", - DatePart("d", TheDate) + 1, TheDate))))
End Function
intX = ComputeLastDayOfMonth("2/2000")
Open the CD TRAY using c# code
The following Code will help us to Open CD Tray By using C# Language:
using System;
using System.Collections.Generic;
using System.Linq;using System.Text;
using System.Runtime.InteropServices;
namespace play
{
class Program
{
[DllImport("winmm.dll")]
public static extern void mciSendString(string s1,string s2, int i,int j);
static void Main(string[] args)
{
char ch;
Console.Write("Enter 'O' to open CD Tray! : ");
ch = Console.ReadKey().KeyChar;
if (ch =='O' ch == 'o')
{
mciSendString("set cdaudio door open",null,0,0);
}
Console.WriteLine();
Console.Write("Enter 'C' to close CD Tray! : ");
ch=Console.ReadKey().KeyChar;
if (ch == 'C' ch == 'c')
{
mciSendString("set cdaudio door closed", null, 0, 0);
}
}
}
}
abstract and virtual member functions?
Virtual methods allow subclasses to provide their own implementation of that method using the override keyword.
Abstract methods in a class contain no method body, and are implicitly virtual.
Neither abstract or virtual can be declared private, since it would defeat the purpose, and subclasses must override them using the same method signature.
If a class has any abstact methods, then it must tag itself as abstract, and no instances of it can be created.