|
yeah,almost.Well,to be more detailed...Im running a system where a user logs in his/her complaints and everytime a new complaint is registered, I need a timer to begin at the server-side.My database is running on SQL Server and the code for the system has so far been written in VB .NET
How do i proceed?
|
|
|
|
|
why do you want to run a timer for every new entry? It sounds overkill to me. Imagine how many timers you will be running.
Can you modify your table schema? I'd add two or more columns
1. StartTime - This is the time when the record was entered
2. ModifyTime - [You may not need this one] This is the time when the record was modifed
3. EndTime - Time when you want to stop timer.
Then at any given time you can compute time from those three columns.
If you can not modify your table, consider adding new table to hold for your those times.
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
Yeah,it does look like overkill to me too.I already have those columns in the table.and i can always add few more if needed.but the point is that at the end of that time i need a process to run.This process is the same for all entries.How do i make it do that?
|
|
|
|
|
liz3 wrote: but the point is that at the end of that time i need a process to run
well, your requirement are a bit blurry to me. Let me see if I got it right. What you want to do is whenever there is an entry to the table you want to run a timer then when some known time elapses, you want to execute something, right?
First you can not do this using asp.net, period.
you have two choices, you can write a standalone application, or even better windows service run your timer and what ever action you want. Or you can do it entirely within SQL server. For this you have to write a trigger and sql job.
I prefer to write standalone application or service rather than do it in SQL.
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
I must have missunderstood your problem the first time.
Let me give an example:
1) Trouble ticket is created at 9:00am
2) At 15 minutes after the ticket is created you need to check to see if it has been assigned to a suppoort representative, if not contact a supervisor as part of an escallation procedure.
Is this something like what you are trying to solve ?
One way to solve this is write a Windows service that checks the database at 2 minute intervals to see if escallation logic needs to be run. You would compare the start time of the trouble ticket and the status to determine what action is required.
|
|
|
|
|
thankyou! i'll try it out!
|
|
|
|
|
Anyone with the solution please?
I need to display the stored procedure return value with a label on my C#.Net form after inserting the records.
Here's my stored procedure:
[dbo].[RecordCustomer]
@FirstName char(25),
@LastName char(25),
@EmailAddress char(40)
AS
begin transaction
declare @id int
insert Customers(LastName, FirstName, EmailAddress)
values(@LastName, @FirstName, @EmailAddress)
select @id = @@identity
commit transaction
return @id
And the C# code for Inserting the Records from the form:
And here is the Dataset(.xsd wizard generated code) Code for inserting the Record:
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.42
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#pragma warning disable 1591
namespace Hotel_Reservation {
using System;
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
[Serializable()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.ComponentModel.ToolboxItem(true)]
[System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedDataSetSchema")]
[System.Xml.Serialization.XmlRootAttribute("DataSetAddCustomer")]
[System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")]
public partial class DataSetAddCustomer : System.Data.DataSet {
private STP_SELECT_ALL_CUSTOMERSDataTable tableSTP_SELECT_ALL_CUSTOMERS;
private System.Data.SchemaSerializationMode _schemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public DataSetAddCustomer() {
this.BeginInit();
this.InitClass();
System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
base.Tables.CollectionChanged += schemaChangedHandler;
base.Relations.CollectionChanged += schemaChangedHandler;
this.EndInit();
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
protected DataSetAddCustomer(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) :
base(info, context, false) {
if ((this.IsBinarySerialized(info, context) == true)) {
this.InitVars(false);
System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler1 = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
this.Tables.CollectionChanged += schemaChangedHandler1;
this.Relations.CollectionChanged += schemaChangedHandler1;
return;
}
string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string))));
if ((this.DetermineSchemaSerializationMode(info, context) == System.Data.SchemaSerializationMode.IncludeSchema)) {
System.Data.DataSet ds = new System.Data.DataSet();
ds.ReadXmlSchema(new System.Xml.XmlTextReader(new System.IO.StringReader(strSchema)));
if ((ds.Tables["STP_SELECT_ALL_CUSTOMERS"] != null)) {
base.Tables.Add(new STP_SELECT_ALL_CUSTOMERSDataTable(ds.Tables["STP_SELECT_ALL_CUSTOMERS"]));
}
this.DataSetName = ds.DataSetName;
this.Prefix = ds.Prefix;
this.Namespace = ds.Namespace;
this.Locale = ds.Locale;
this.CaseSensitive = ds.CaseSensitive;
this.EnforceConstraints = ds.EnforceConstraints;
this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
this.InitVars();
}
else {
this.ReadXmlSchema(new System.Xml.XmlTextReader(new System.IO.StringReader(strSchema)));
}
this.GetSerializationData(info, context);
System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
base.Tables.CollectionChanged += schemaChangedHandler;
this.Relations.CollectionChanged += schemaChangedHandler;
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.ComponentModel.Browsable(false)]
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Content)]
public STP_SELECT_ALL_CUSTOMERSDataTable STP_SELECT_ALL_CUSTOMERS {
get {
return this.tableSTP_SELECT_ALL_CUSTOMERS;
}
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.ComponentModel.BrowsableAttribute(true)]
[System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Visible)]
public override System.Data.SchemaSerializationMode SchemaSerializationMode {
get {
return this._schemaSerializationMode;
}
set {
this._schemaSerializationMode = value;
}
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
public new System.Data.DataTableCollection Tables {
get {
return base.Tables;
}
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
public new System.Data.DataRelationCollection Relations {
get {
return base.Relations;
}
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
protected override void InitializeDerivedDataSet() {
this.BeginInit();
this.InitClass();
this.EndInit();
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public override System.Data.DataSet Clone() {
DataSetAddCustomer cln = ((DataSetAddCustomer)(base.Clone()));
cln.InitVars();
cln.SchemaSerializationMode = this.SchemaSerializationMode;
return cln;
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
protected override bool ShouldSerializeTables() {
return false;
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
protected override bool ShouldSerializeRelations() {
return false;
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
protected override void ReadXmlSerializable(System.Xml.XmlReader reader) {
if ((this.DetermineSchemaSerializationMode(reader) == System.Data.SchemaSerializationMode.IncludeSchema)) {
this.Reset();
System.Data.DataSet ds = new System.Data.DataSet();
ds.ReadXml(reader);
if ((ds.Tables["STP_SELECT_ALL_CUSTOMERS"] != null)) {
base.Tables.Add(new STP_SELECT_ALL_CUSTOMERSDataTable(ds.Tables["STP_SELECT_ALL_CUSTOMERS"]));
}
this.DataSetName = ds.DataSetName;
this.Prefix = ds.Prefix;
this.Namespace = ds.Namespace;
this.Locale = ds.Locale;
this.CaseSensitive = ds.CaseSensitive;
this.EnforceConstraints = ds.EnforceConstraints;
this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
this.InitVars();
}
else {
this.ReadXml(reader);
this.InitVars();
}
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
protected override System.Xml.Schema.XmlSchema GetSchemaSerializable() {
System.IO.MemoryStream stream = new System.IO.MemoryStream();
this.WriteXmlSchema(new System.Xml.XmlTextWriter(stream, null));
stream.Position = 0;
return System.Xml.Schema.XmlSchema.Read(new System.Xml.XmlTextReader(stream), null);
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
internal void InitVars() {
this.InitVars(true);
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
internal void InitVars(bool initTable) {
this.tableSTP_SELECT_ALL_CUSTOMERS = ((STP_SELECT_ALL_CUSTOMERSDataTable)(base.Tables["STP_SELECT_ALL_CUSTOMERS"]));
if ((initTable == true)) {
if ((this.tableSTP_SELECT_ALL_CUSTOMERS != null)) {
this.tableSTP_SELECT_ALL_CUSTOMERS.InitVars();
}
}
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
private void InitClass() {
this.DataSetName = "DataSetAddCustomer";
this.Prefix = "";
this.Namespace = "http://tempuri.org/DataSetAddCustomer.xsd";
this.EnforceConstraints = true;
this.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema;
this.tableSTP_SELECT_ALL_CUSTOMERS = new STP_SELECT_ALL_CUSTOMERSDataTable();
base.Tables.Add(this.tableSTP_SELECT_ALL_CUSTOMERS);
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
private bool ShouldSerializeSTP_SELECT_ALL_CUSTOMERS() {
return false;
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
private void SchemaChanged(object sender, System.ComponentModel.CollectionChangeEventArgs e) {
if ((e.Action == System.ComponentModel.CollectionChangeAction.Remove)) {
this.InitVars();
}
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(System.Xml.Schema.XmlSchemaSet xs) {
DataSetAddCustomer ds = new DataSetAddCustomer();
System.Xml.Schema.XmlSchemaComplexType type = new System.Xml.Schema.XmlSchemaComplexType();
System.Xml.Schema.XmlSchemaSequence sequence = new System.Xml.Schema.XmlSchemaSequence();
xs.Add(ds.GetSchemaSerializable());
System.Xml.Schema.XmlSchemaAny any = new System.Xml.Schema.XmlSchemaAny();
any.Namespace = ds.Namespace;
sequence.Items.Add(any);
type.Particle = sequence;
return type;
}
public delegate void STP_SELECT_ALL_CUSTOMERSRowChangeEventHandler(object sender, STP_SELECT_ALL_CUSTOMERSRowChangeEvent e);
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
[System.Serializable()]
[System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")]
public partial class STP_SELECT_ALL_CUSTOMERSDataTable : System.Data.DataTable, System.Collections.IEnumerable {
private System.Data.DataColumn columnCustomerId;
private System.Data.DataColumn columnFirstName;
private System.Data.DataColumn columnLastName;
private System.Data.DataColumn columnEmailAddress;
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public STP_SELECT_ALL_CUSTOMERSDataTable() {
this.TableName = "STP_SELECT_ALL_CUSTOMERS";
this.BeginInit();
this.InitClass();
this.EndInit();
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
internal STP_SELECT_ALL_CUSTOMERSDataTable(System.Data.DataTable table) {
this.TableName = table.TableName;
if ((table.CaseSensitive != table.DataSet.CaseSensitive)) {
this.CaseSensitive = table.CaseSensitive;
}
if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) {
this.Locale = table.Locale;
}
if ((table.Namespace != table.DataSet.Namespace)) {
this.Namespace = table.Namespace;
}
this.Prefix = table.Prefix;
this.MinimumCapacity = table.MinimumCapacity;
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
protected STP_SELECT_ALL_CUSTOMERSDataTable(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) :
base(info, context) {
this.InitVars();
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public System.Data.DataColumn CustomerIdColumn {
get {
return this.columnCustomerId;
}
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public System.Data.DataColumn FirstNameColumn {
get {
return this.columnFirstName;
}
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public System.Data.DataColumn LastNameColumn {
get {
return this.columnLastName;
}
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public System.Data.DataColumn EmailAddressColumn {
get {
return this.columnEmailAddress;
}
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.ComponentModel.Browsable(false)]
public int Count {
get {
return this.Rows.Count;
}
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public STP_SELECT_ALL_CUSTOMERSRow this[int index] {
get {
return ((STP_SELECT_ALL_CUSTOMERSRow)(this.Rows[index]));
}
}
public event STP_SELECT_ALL_CUSTOMERSRowChangeEventHandler STP_SELECT_ALL_CUSTOMERSRowChanging;
public event STP_SELECT_ALL_CUSTOMERSRowChangeEventHandler STP_SELECT_ALL_CUSTOMERSRowChanged;
public event STP_SELECT_ALL_CUSTOMERSRowChangeEventHandler STP_SELECT_ALL_CUSTOMERSRowDeleting;
public event STP_SELECT_ALL_CUSTOMERSRowChangeEventHandler STP_SELECT_ALL_CUSTOMERSRowDeleted;
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public void AddSTP_SELECT_ALL_CUSTOMERSRow(STP_SELECT_ALL_CUSTOMERSRow row) {
this.Rows.Add(row);
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public STP_SELECT_ALL_CUSTOMERSRow AddSTP_SELECT_ALL_CUSTOMERSRow(string FirstName, string LastName, string EmailAddress) {
STP_SELECT_ALL_CUSTOMERSRow rowSTP_SELECT_ALL_CUSTOMERSRow = ((STP_SELECT_ALL_CUSTOMERSRow)(this.NewRow()));
rowSTP_SELECT_ALL_CUSTOMERSRow.ItemArray = new object[] {
null,
FirstName,
LastName,
EmailAddress};
this.Rows.Add(rowSTP_SELECT_ALL_CUSTOMERSRow);
return rowSTP_SELECT_ALL_CUSTOMERSRow;
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public STP_SELECT_ALL_CUSTOMERSRow FindByCustomerId(int CustomerId) {
return ((STP_SELECT_ALL_CUSTOMERSRow)(this.Rows.Find(new object[] {
CustomerId})));
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public virtual System.Collections.IEnumerator GetEnumerator() {
return this.Rows.GetEnumerator();
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public override System.Data.DataTable Clone() {
STP_SELECT_ALL_CUSTOMERSDataTable cln = ((STP_SELECT_ALL_CUSTOMERSDataTable)(base.Clone()));
cln.InitVars();
return cln;
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
protected override System.Data.DataTable CreateInstance() {
return new STP_SELECT_ALL_CUSTOMERSDataTable();
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
internal void InitVars() {
this.columnCustomerId = base.Columns["CustomerId"];
this.columnFirstName = base.Columns["FirstName"];
this.columnLastName = base.Columns["LastName"];
this.columnEmailAddress = base.Columns["EmailAddress"];
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
private void InitClass() {
this.columnCustomerId = new System.Data.DataColumn("CustomerId", typeof(int), null, System.Data.MappingType.Element);
base.Columns.Add(this.columnCustomerId);
this.columnFirstName = new System.Data.DataColumn("FirstName", typeof(string), null, System.Data.MappingType.Element);
base.Columns.Add(this.columnFirstName);
this.columnLastName = new System.Data.DataColumn("LastName", typeof(string), null, System.Data.MappingType.Element);
base.Columns.Add(this.columnLastName);
this.columnEmailAddress = new System.Data.DataColumn("EmailAddress", typeof(string), null, System.Data.MappingType.Element);
base.Columns.Add(this.columnEmailAddress);
this.Constraints.Add(new System.Data.UniqueConstraint("Constraint1", new System.Data.DataColumn[] {
this.columnCustomerId}, true));
this.columnCustomerId.AutoIncrement = true;
this.columnCustomerId.AllowDBNull = false;
this.columnCustomerId.ReadOnly = true;
this.columnCustomerId.Unique = true;
this.columnFirstName.AllowDBNull = false;
this.columnFirstName.MaxLength = 40;
this.columnLastName.AllowDBNull = false;
this.columnLastName.MaxLength = 40;
this.columnEmailAddress.MaxLength = 50;
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public STP_SELECT_ALL_CUSTOMERSRow NewSTP_SELECT_ALL_CUSTOMERSRow() {
return ((STP_SELECT_ALL_CUSTOMERSRow)(this.NewRow()));
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
protected override System.Data.DataRow NewRowFromBuilder(System.Data.DataRowBuilder builder) {
return new STP_SELECT_ALL_CUSTOMERSRow(builder);
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
protected override System.Type GetRowType() {
return typeof(STP_SELECT_ALL_CUSTOMERSRow);
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
protected override void OnRowChanged(System.Data.DataRowChangeEventArgs e) {
base.OnRowChanged(e);
if ((this.STP_SELECT_ALL_CUSTOMERSRowChanged != null)) {
this.STP_SELECT_ALL_CUSTOMERSRowChanged(this, new STP_SELECT_ALL_CUSTOMERSRowChangeEvent(((STP_SELECT_ALL_CUSTOMERSRow)(e.Row)), e.Action));
}
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
protected override void OnRowChanging(System.Data.DataRowChangeEventArgs e) {
base.OnRowChanging(e);
if ((this.STP_SELECT_ALL_CUSTOMERSRowChanging != null)) {
this.STP_SELECT_ALL_CUSTOMERSRowChanging(this, new STP_SELECT_ALL_CUSTOMERSRowChangeEvent(((STP_SELECT_ALL_CUSTOMERSRow)(e.Row)), e.Action));
}
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
protected override void OnRowDeleted(System.Data.DataRowChangeEventArgs e) {
base.OnRowDeleted(e);
if ((this.STP_SELECT_ALL_CUSTOMERSRowDeleted != null)) {
this.STP_SELECT_ALL_CUSTOMERSRowDeleted(this, new STP_SELECT_ALL_CUSTOMERSRowChangeEvent(((STP_SELECT_ALL_CUSTOMERSRow)(e.Row)), e.Action));
}
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
protected override void OnRowDeleting(System.Data.DataRowChangeEventArgs e) {
base.OnRowDeleting(e);
if ((this.STP_SELECT_ALL_CUSTOMERSRowDeleting != null)) {
this.STP_SELECT_ALL_CUSTOMERSRowDeleting(this, new STP_SELECT_ALL_CUSTOMERSRowChangeEvent(((STP_SELECT_ALL_CUSTOMERSRow)(e.Row)), e.Action));
}
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public void RemoveSTP_SELECT_ALL_CUSTOMERSRow(STP_SELECT_ALL_CUSTOMERSRow row) {
this.Rows.Remove(row);
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public static System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(System.Xml.Schema.XmlSchemaSet xs) {
System.Xml.Schema.XmlSchemaComplexType type = new System.Xml.Schema.XmlSchemaComplexType();
System.Xml.Schema.XmlSchemaSequence sequence = new System.Xml.Schema.XmlSchemaSequence();
DataSetAddCustomer ds = new DataSetAddCustomer();
xs.Add(ds.GetSchemaSerializable());
System.Xml.Schema.XmlSchemaAny any1 = new System.Xml.Schema.XmlSchemaAny();
any1.Namespace = "http://www.w3.org/2001/XMLSchema";
any1.MinOccurs = new decimal(0);
any1.MaxOccurs = decimal.MaxValue;
any1.ProcessContents = System.Xml.Schema.XmlSchemaContentProcessing.Lax;
sequence.Items.Add(any1);
System.Xml.Schema.XmlSchemaAny any2 = new System.Xml.Schema.XmlSchemaAny();
any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1";
any2.MinOccurs = new decimal(1);
any2.ProcessContents = System.Xml.Schema.XmlSchemaContentProcessing.Lax;
sequence.Items.Add(any2);
System.Xml.Schema.XmlSchemaAttribute attribute1 = new System.Xml.Schema.XmlSchemaAttribute();
attribute1.Name = "namespace";
attribute1.FixedValue = ds.Namespace;
type.Attributes.Add(attribute1);
System.Xml.Schema.XmlSchemaAttribute attribute2 = new System.Xml.Schema.XmlSchemaAttribute();
attribute2.Name = "tableTypeName";
attribute2.FixedValue = "STP_SELECT_ALL_CUSTOMERSDataTable";
type.Attributes.Add(attribute2);
type.Particle = sequence;
return type;
}
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
public partial class STP_SELECT_ALL_CUSTOMERSRow : System.Data.DataRow {
private STP_SELECT_ALL_CUSTOMERSDataTable tableSTP_SELECT_ALL_CUSTOMERS;
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
internal STP_SELECT_ALL_CUSTOMERSRow(System.Data.DataRowBuilder rb) :
base(rb) {
this.tableSTP_SELECT_ALL_CUSTOMERS = ((STP_SELECT_ALL_CUSTOMERSDataTable)(this.Table));
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public int CustomerId {
get {
return ((int)(this[this.tableSTP_SELECT_ALL_CUSTOMERS.CustomerIdColumn]));
}
set {
this[this.tableSTP_SELECT_ALL_CUSTOMERS.CustomerIdColumn] = value;
}
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public string FirstName {
get {
return ((string)(this[this.tableSTP_SELECT_ALL_CUSTOMERS.FirstNameColumn]));
}
set {
this[this.tableSTP_SELECT_ALL_CUSTOMERS.FirstNameColumn] = value;
}
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public string LastName {
get {
return ((string)(this[this.tableSTP_SELECT_ALL_CUSTOMERS.LastNameColumn]));
}
set {
this[this.tableSTP_SELECT_ALL_CUSTOMERS.LastNameColumn] = value;
}
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public string EmailAddress {
get {
try {
return ((string)(this[this.tableSTP_SELECT_ALL_CUSTOMERS.EmailAddressColumn]));
}
catch (System.InvalidCastException e) {
throw new System.Data.StrongTypingException("The value for column \'EmailAddress\' in table \'STP_SELECT_ALL_CUSTOMERS\' is DBNull" +
".", e);
}
}
set {
this[this.tableSTP_SELECT_ALL_CUSTOMERS.EmailAddressColumn] = value;
}
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public bool IsEmailAddressNull() {
return this.IsNull(this.tableSTP_SELECT_ALL_CUSTOMERS.EmailAddressColumn);
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public void SetEmailAddressNull() {
this[this.tableSTP_SELECT_ALL_CUSTOMERS.EmailAddressColumn] = System.Convert.DBNull;
}
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
public class STP_SELECT_ALL_CUSTOMERSRowChangeEvent : System.EventArgs {
private STP_SELECT_ALL_CUSTOMERSRow eventRow;
private System.Data.DataRowAction eventAction;
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public STP_SELECT_ALL_CUSTOMERSRowChangeEvent(STP_SELECT_ALL_CUSTOMERSRow row, System.Data.DataRowAction action) {
this.eventRow = row;
this.eventAction = action;
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public STP_SELECT_ALL_CUSTOMERSRow Row {
get {
return this.eventRow;
}
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public System.Data.DataRowAction Action {
get {
return this.eventAction;
}
}
}
}
}
namespace Hotel_Reservation.DataSetAddCustomerTableAdapters {
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.ComponentModel.ToolboxItem(true)]
[System.ComponentModel.DataObjectAttribute(true)]
[System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner" +
", Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
public partial class STP_SELECT_ALL_CUSTOMERSTableAdapter : System.ComponentModel.Component {
private System.Data.SqlClient.SqlDataAdapter _adapter;
private System.Data.SqlClient.SqlConnection _connection;
private System.Data.SqlClient.SqlCommand[] _commandCollection;
private bool _clearBeforeFill;
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public STP_SELECT_ALL_CUSTOMERSTableAdapter() {
this.ClearBeforeFill = true;
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
private System.Data.SqlClient.SqlDataAdapter Adapter {
get {
if ((this._adapter == null)) {
this.InitAdapter();
}
return this._adapter;
}
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
internal System.Data.SqlClient.SqlConnection Connection {
get {
if ((this._connection == null)) {
this.InitConnection();
}
return this._connection;
}
set {
this._connection = value;
if ((this.Adapter.InsertCommand != null)) {
this.Adapter.InsertCommand.Connection = value;
}
if ((this.Adapter.DeleteCommand != null)) {
this.Adapter.DeleteCommand.Connection = value;
}
if ((this.Adapter.UpdateCommand != null)) {
this.Adapter.UpdateCommand.Connection = value;
}
for (int i = 0; (i < this.CommandCollection.Length); i = (i + 1)) {
if ((this.CommandCollection[i] != null)) {
((System.Data.SqlClient.SqlCommand)(this.CommandCollection[i])).Connection = value;
}
}
}
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
protected System.Data.SqlClient.SqlCommand[] CommandCollection {
get {
if ((this._commandCollection == null)) {
this.InitCommandCollection();
}
return this._commandCollection;
}
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public bool ClearBeforeFill {
get {
return this._clearBeforeFill;
}
set {
this._clearBeforeFill = value;
}
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
private void InitAdapter() {
this._adapter = new System.Data.SqlClient.SqlDataAdapter();
System.Data.Common.DataTableMapping tableMapping = new System.Data.Common.DataTableMapping();
tableMapping.SourceTable = "Table";
tableMapping.DataSetTable = "STP_SELECT_ALL_CUSTOMERS";
tableMapping.ColumnMappings.Add("CustomerId", "CustomerId");
tableMapping.ColumnMappings.Add("FirstName", "FirstName");
tableMapping.ColumnMappings.Add("LastName", "LastName");
tableMapping.ColumnMappings.Add("EmailAddress", "EmailAddress");
this._adapter.TableMappings.Add(tableMapping);
this._adapter.InsertCommand = new System.Data.SqlClient.SqlCommand();
this._adapter.InsertCommand.Connection = this.Connection;
this._adapter.InsertCommand.CommandText = "dbo.RecordCustomer";
this._adapter.InsertCommand.CommandType = System.Data.CommandType.StoredProcedure;
this._adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, 10, 0, "CustomerId", System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@LastName", System.Data.SqlDbType.Char, 25, System.Data.ParameterDirection.Input, 0, 0, "LastName", System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@FirstName", System.Data.SqlDbType.Char, 25, System.Data.ParameterDirection.Input, 0, 0, "FirstName", System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._adapter.InsertCommand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@EmailAddress", System.Data.SqlDbType.Char, 40, System.Data.ParameterDirection.Input, 0, 0, "EmailAddress", System.Data.DataRowVersion.Current, false, null, "", "", ""));
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
private void InitConnection() {
this._connection = new System.Data.SqlClient.SqlConnection();
this._connection.ConnectionString = global::Hotel_Reservation.Properties.Settings.Default.HotelBrokerConnectionString;
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
private void InitCommandCollection() {
this._commandCollection = new System.Data.SqlClient.SqlCommand[1];
this._commandCollection[0] = new System.Data.SqlClient.SqlCommand();
this._commandCollection[0].Connection = this.Connection;
this._commandCollection[0].CommandText = "dbo.STP_SELECT_ALL_CUSTOMERS";
this._commandCollection[0].CommandType = System.Data.CommandType.StoredProcedure;
this._commandCollection[0].Parameters.Add(new System.Data.SqlClient.SqlParameter("@RETURN_VALUE", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, 10, 0, "", System.Data.DataRowVersion.Current, false, null, "", "", ""));
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Fill, true)]
public virtual int Fill(DataSetAddCustomer.STP_SELECT_ALL_CUSTOMERSDataTable dataTable) {
this.Adapter.SelectCommand = this.CommandCollection[0];
if ((this.ClearBeforeFill == true)) {
dataTable.Clear();
}
int returnValue = this.Adapter.Fill(dataTable);
return returnValue;
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, true)]
public virtual DataSetAddCustomer.STP_SELECT_ALL_CUSTOMERSDataTable GetData() {
this.Adapter.SelectCommand = this.CommandCollection[0];
DataSetAddCustomer.STP_SELECT_ALL_CUSTOMERSDataTable dataTable = new DataSetAddCustomer.STP_SELECT_ALL_CUSTOMERSDataTable();
this.Adapter.Fill(dataTable);
return dataTable;
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
public virtual int Update(DataSetAddCustomer.STP_SELECT_ALL_CUSTOMERSDataTable dataTable) {
return this.Adapter.Update(dataTable);
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
public virtual int Update(DataSetAddCustomer dataSet) {
return this.Adapter.Update(dataSet, "STP_SELECT_ALL_CUSTOMERS");
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
public virtual int Update(System.Data.DataRow dataRow) {
return this.Adapter.Update(new System.Data.DataRow[] {
dataRow});
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
public virtual int Update(System.Data.DataRow[] dataRows) {
return this.Adapter.Update(dataRows);
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Insert, true)]
public virtual int Insert(string LastName, string FirstName, string EmailAddress) {
if ((LastName == null)) {
this.Adapter.InsertCommand.Parameters[1].Value = System.DBNull.Value;
}
else {
this.Adapter.InsertCommand.Parameters[1].Value = ((string)(LastName));
}
if ((FirstName == null)) {
this.Adapter.InsertCommand.Parameters[2].Value = System.DBNull.Value;
}
else {
this.Adapter.InsertCommand.Parameters[2].Value = ((string)(FirstName));
}
if ((EmailAddress == null)) {
this.Adapter.InsertCommand.Parameters[3].Value = System.DBNull.Value;
}
else {
this.Adapter.InsertCommand.Parameters[3].Value = ((string)(EmailAddress));
}
System.Data.ConnectionState previousConnectionState = this.Adapter.InsertCommand.Connection.State;
if (((this.Adapter.InsertCommand.Connection.State & System.Data.ConnectionState.Open)
!= System.Data.ConnectionState.Open)) {
this.Adapter.InsertCommand.Connection.Open();
}
try {
int returnValue = this.Adapter.InsertCommand.ExecuteNonQuery();
return returnValue;
}
finally {
if ((previousConnectionState == System.Data.ConnectionState.Closed)) {
this.Adapter.InsertCommand.Connection.Close();
}
}
}
}
}
#pragma warning restore 1591
|
|
|
|
|
What is this? You are just trying to Spamming this forum. If you are going to ask question like this, no one will give you the answer. Because you don't know how to ask questions.
No one will going to read your read thousand line of code.
First of all your
Best1 wrote: gForum: ASP.NET
Subject: Displaying a return value from Stored procedure in C#.Net Windows form Application
Your subject says, your problem in your windows application, but you are posting in ASP.NET forum.
Now, come to your answer, If you are returning value form Stored procedure, you can easily read in any variable using Parameter Direction . Now try to googling and try to find some thing on that word , that I have highlighted.
And, from next time rather than posting thousand line of code, please post those line which you thing relevant for question . This will help you to get the answer, and help us to give the answer .
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
Two things:
1. This is the ASP.NET forum, you need the WinForms forum
2. Too much code - supply only the relevant part. People are very unlikely to read all that you have supplied - they don't have the time.
|
|
|
|
|
Dude you need to do is something like this. .
SqlCommand cmd = new SqlCommand();
cmd.Connection = cn;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "YourStoredProcedureName";
cmd.Parameters.AddWithValue("FirstName",this.FirstName);
..
..
Parameter param = new Parameter("ID");
param.Direction = Output.
And in Stored procedure it should be like this.
[dbo].[RecordCustomer]
@FirstName char(25),
@LastName char(25),
@EmailAddress char(40),
@ID int output
AS
begin transaction
insert Customers(LastName, FirstName, EmailAddress)
values(@LastName, @FirstName, @EmailAddress)
select @id = @@identity
commit transaction
And to get the value you need to do is
int res = Convert.ToInt32(cmd.Parameters["ID"].Value);
there you get the result..
Do whatever you want to do with it ..
And please post your windows application queries in C# forum
|
|
|
|
|
Hi Friends,
Im creating one shopping cart aplication, im having header section part common in all pages, so i placed it in the master page. In master page im hvng one label as Label Guest. When user logins with their id and after successful login it will redirect to home page,that time the label guest will be change according to their first name. Can anyone tell me how to implement this. The same thing i implemented without master page.
|
|
|
|
|
If you add <%@ MasterType VirtualPath="~/MasterPage.master" %> into the content page (with correct path and filename of course.
Then you can access your label from the content page using Master.Label.Text.
Another method is to use a session variable which can be set from the content page and read from the master page.
|
|
|
|
|
In the master code-behind you could check Request.IsAuthenticated in OnLoad(), if true then set the label.Text = Page.User.Identity.Name.
...cmk
The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.
- John Carmack
|
|
|
|
|
Hi all,
I am trying to gather which of the check boxes within the data grid is checked. As far I have tries the following without success:
foreach (GridViewRow row in GridView1.Rows)
{
CheckBox c = (CheckBox)GridView1.Rows[0].Cells[0].FindControl("chkSelection") as CheckBox;
if (c.Checked)
{
Response.Write("Hello");
}
}
How can I know which check boxes were checked in the grid?
Many thanks in advance
Kind regards,
|
|
|
|
|
Where did you write these line of code?
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
The code is in a click event of a button on the server side.
regards
JP
|
|
|
|
|
why don't you add columns through property window of datagridview control where you define column name and column type.
For e.g
//Client Side Code
this.dgvVesselDetails = new System.Windows.Forms.DataGridView();
this.IsSelect = new System.Windows.Forms.DataGridViewCheckBoxColumn();
dgvVesselDetails .Columns.AddRange(new System.web.Forms.DataGridViewColumn[] {
this.IsSelect}
//
// IsSelect
//
this.IsSelect.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
resources.ApplyResources(this.IsSelect, "IsSelect");
this.IsSelect.Name = "IsSelect";
//Server Side Code
foreach (DataGridViewRow row in dgvVesselDetails.Rows)
{
if(row.Cells["IsSelect"].Value)
{
//do stuff
Response.write("Hello World");
}
}
Regards
Annpurna
|
|
|
|
|
Hi All,
I want to install windows service on server.
Is there any tool use for running and installing the service?
On the local machine It works Successfully Now I want to install on the server.
Thanks
Sjs4u
|
|
|
|
|
sjs4u wrote: On the local machine It works Successfully Now I want to install on the server.
How did you install it local system ? you have to do the same thing also in server.
sjs4u wrote: Is there any tool use for running and installing the service?
Go to Visual Studio Command Prompt > Run command : installutil <your servicename.exe=""></your>
BTW : It's not a ASP.NET Question.
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
I have a standard datagrid populated from an access database. When i click on edit the datagrid rows are exposed as text boxes and expand across the whole page, is there any easy way to stop this from happening or to limit the size of each tect box while updating
|
|
|
|
|
Use ControlStyle-Width for edit mode width of the boundfield
Use ItemStyle-Width for display mode width of the boundfield
In Word you can only store 2 bytes. That is why I use Writer.
|
|
|
|
|
Hi,
We are using localization in asp.net with resource files.
We have a default.resx resource file for a default.aspx page and a default.aspx.hi-in.resx to support hindi.
The problem is that when we type in hindi in the resource file we see junk characters.
So do we have to install any language pack to the .net solutions in order to support hindi language or fonts.
And also how to load data dynamically to drop down list using resource files for multi-lingual site.
thanks,
sabiha.
|
|
|
|
|
Dear Friends,
I have a web application running from 10 different places. Application Server is their local server. But Database server is same for all. There is only one login ID created for all users to access pages (Form Based Authentication).
Will be any Problem in Sessions ?
Because on my system I logged with that user name. I have used Login View to show login status. I have written logged in Template and Anonymous user Template. When I login it is showing correcty with my name. After some time it is displaying as Guest (login). But I have not logged out. I dont know why it showing so....
Please help me out....
Nayak
|
|
|
|
|
It's more likely that your session has simply died.
Far as I'm concerned, the default timeout for sessions is 10 minutes (or is it 20? I'm not sure).
So even though you have not logged out manually, I am sure you have some facilities in place to do that for you, if the login session is dead.
Now ask yourself how long you had been logged in without performing any postbacks on the page to keep the session alive and see if it exceeded 10 minutes.
... and don't say your query is urgent. It might be to you, but it's totally irrelevant to others.
var question = (_2b || !(_2b));
|
|
|
|
|
Hi,
You are right. But in Web.Config file I have mentioned this line.
<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="UseCookies" timeout="1400" />
Still what could be the problem ?
Ramesh Sambari
|
|
|
|
|