Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
J

jacklynn_mei

@jacklynn_mei
About
Posts
24
Topics
7
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Displaying data one by one using timer
    J jacklynn_mei

    Thank you very much...You've help me a lot... Thank you...

    C# database help tutorial question

  • Displaying data one by one using timer
    J jacklynn_mei

    Thanks... But after tried, it wont loop to the first data. After reading the 3rd data, it will error since there is no data on the position 3 (4th data) (my table only have 3 data).

    C# database help tutorial question

  • Displaying data one by one using timer
    J jacklynn_mei

    I have done something like the code below But after reading the last data, it encounter error since there is no data persistent while reading. public partial class tempA : Form { SqlDataReader m_Reader; DataSet ds = new DataSet(); private void tempA_Load(object sender, EventArgs e) { string conStrg; conStrg = ("Data Source=DIMENSION3000\\SQLEXPRESS;Initial Catalog=kMasjid;User ID=sa;password=123456"); SqlConnection connTimer = new SqlConnection(conStrg); connTimer.Open(); string selSQL = "Select txtDesc FROM txtScroll"; SqlCommand com = new SqlCommand(selSQL, connTimer); SqlDataAdapter da = new SqlDataAdapter(com); da.Fill(ds, "txtScroll"); m_Reader = com.ExecuteReader(); m_Reader.Read(); Timer myTimer = new Timer(); myTimer.Interval = 5000; myTimer.Enabled = true; myTimer.Start(); myTimer.Tick += new EventHandler(Timer_Tick); } public void Timer_Tick(object sender, EventArgs e) { alphaTxtMain.Text = " " + m_Reader["txtDesc"]; m_Reader.Read() } }

    C# database help tutorial question

  • Displaying data one by one using timer
    J jacklynn_mei

    Winform Application

    C# database help tutorial question

  • Displaying data one by one using timer
    J jacklynn_mei

    Hi... I have problem with my timer code. I want to display the data from the sql database on textbox using timer tick event. For an example there are 3 data in the database which are apple,banana,coconut. apple will appear first and after 10 seconds banana will appear, and after 10 seconds coconut will appear. And then, after the last data (coconut) appeared, the first data (apple) appeared again, and so on. It will continuously loop. I want to do like this. Any suggestion or reference? Thanks Jac

    C# database help tutorial question

  • Timer Display data from database
    J jacklynn_mei

    Mmm..it's like blinking. Supposed that, the output is 10secs for each data to be displayed.

    C# database help tutorial question

  • Timer Display data from database
    J jacklynn_mei

    Dude..have done like the code below but the data cannot display for 10secs. public load(....) { Timer myTimer = new Timer(); myTimer.Interval = 10000; myTimer.Enabled = true; myTimer.Tick += new EventHandler(Timer_Tick); } public void Timer_Tick(object sender, EventArgs e) { string conStrg; conStrg = ("Data Source=DIMENSION3000\\SQLEXPRESS;Initial Catalog=kMasjid;User ID=sa;password=123456"); SqlConnection connTimer = new SqlConnection(conStrg); connTimer.Open(); string selSQL = "Select txtDesc FROM txtScroll"; SqlCommand com = new SqlCommand(selSQL, connTimer); SqlDataReader reader = com.ExecuteReader(); DataSet ds = new DataSet(); while (reader.Read()) { alphaTxtMain.Text = " " + reader["txtDesc"]; myTimer.Interval = 10000; myTimer.Stop(); }

    C# database help tutorial question

  • Timer Display data from database
    J jacklynn_mei

    I have done something like the code below. It will display the data but, it won't display for 10 seconds it will read all the data from database then only the timer stop for 10 seconds. What i'm expected is, each data display at 10 seconds of time then only continue to the next data and so on... public load(....) { Timer myTimer = new Timer(); myTimer.Interval = 10000; myTimer.Enabled = true; myTimer.Tick += new EventHandler(Timer_Tick); } public void Timer_Tick(object sender, EventArgs e) { string conStrg; conStrg = ("Data Source=DIMENSION3000\\SQLEXPRESS;Initial Catalog=kMasjid;User ID=sa;password=123456"); SqlConnection connTimer = new SqlConnection(conStrg); connTimer.Open(); string selSQL = "Select txtDesc FROM txtScroll"; SqlCommand com = new SqlCommand(selSQL, connTimer); SqlDataReader reader = com.ExecuteReader(); DataSet ds = new DataSet(); while (reader.Read()) { alphaTxtMain.Text = " " + reader["txtDesc"]; myTimer.Interval = 10000; myTimer.Stop(); }

    C# database help tutorial question

  • Timer Display data from database
    J jacklynn_mei

    Hello... Can some body help me with Timer? I want to display the data from my database. For an example: i) 1st data will be displayed ( 10 seconds) ii)After 10 seconds finish, 2nd data will be displayed iii) These data will be displayed continuously (looping) Please help me. Thanks in advance Jac

    C# database help tutorial question

  • RichTextBox Marquee
    J jacklynn_mei

    Dear Abhijit... Since i'm very new in c#, i hope that you can explain more detail... Thanks

    C# tutorial question

  • RichTextBox Marquee
    J jacklynn_mei

    Hello out there. How to marquee the richTextBox in winform? Thanks. Jac

    C# tutorial question

  • [Message Deleted]
    J jacklynn_mei

    [Message Deleted]

    C#

  • Error on ISynchronizeInvoke casting
    J jacklynn_mei

    oic... Actually the idea is like this: - i want to display all the record(s) inside the database - the connection is always there, so that i can retrieve the records. For an example, if i insert a new data the data will be displayed instantly (no need to refresh or debug once again). thanks, Jac

    C# help csharp

  • Error on ISynchronizeInvoke casting
    J jacklynn_mei

    what should i do if i have an error in ISynchronizeInvoke casting. Actually i am doing a c# console application that use ISynchronizeInvoke the code is like this: ISynchronizeInvoke i = (ISynchronizeInvoke)this; The Error: Unable to cast object of type 'ArtIntelTania.Program' to type 'System.ComponentModel.ISynchronizeInvoke'. hope somebody can help me Thanks in advance Regard, jac

    C# help csharp

  • how to do the sqlClr connection & deploy it in c# Express Edition?
    J jacklynn_mei

    ok then...thanks a lot for helping me.. regard, jac

    C# csharp help tutorial question

  • how to do the sqlClr connection & deploy it in c# Express Edition?
    J jacklynn_mei

    this is my trigger: CREATE TRIGGER AITrigger ON AIEvent FOR INSERT AS EXTERNAL NAME [AIClass].[AIClass.AICheck].[checkUserRole]

    C# csharp help tutorial question

  • how to do the sqlClr connection & deploy it in c# Express Edition?
    J jacklynn_mei

    then after i have read about the trigger..I do like this (will call AIClass at the main class): using System; using System.Collections.Generic; using System.Text; using Microsoft.SqlServer.Server; using System.Data; using System.Data.SqlClient; namespace AIClass { public class AICheck { [SqlTrigger(Event = "FOR INSERT", Name = "AITrigger", Target = "AIEvent")] public static void checkUserRole() { //if (!SqlContext.IsAvailable) //{ // Console.Write("Context none"); // Console.Read(); //} //else //{ SqlTriggerContext tgContext = SqlContext.TriggerContext; SqlConnection conn = new SqlConnection("Data Source=DIMENSION3000\\SQLEXPRESS; Initial Catalog=AITania; User Id=sa; Password=123456"); using ( conn = new SqlConnection("context connection=true")) { conn.Open(); //SqlCommand cmd = conn.CreateCommand(); SqlDataReader reader; //cmd.ExecuteNonQuery(); string msg = ""; if (tgContext.TriggerAction == TriggerAction.Insert) { SqlCommand sqlComm = new SqlCommand("SELECT * FROM INSERTED",conn); //cmd.CommandText = "SELECT * FROM INSERTED"; SqlContext.Pipe.ExecuteAndSend(sqlComm); //reader = cmd.ExecuteReader(); //sqlComm.Connection = conn; //sqlComm.CommandText = "SELECT * FROM INSERTED"; //for (int x = 0; x < tgContext.ColumnCount; ++x) //{ // msg += string.Format("Column {0} {1} been updated{2}", x, (tgContext.IsUpdatedColumn(x) ? "has" : "has not"), Environment.NewLine); //} for (int i = 0; i < reader.FieldCount; i++) { msg = msg + reader.GetName(i) + ":" + (string)reader[i] + " "; } } conn.Close(); } //} } } }

    C# csharp help tutorial question

  • how to do the sqlClr connection & deploy it in c# Express Edition?
    J jacklynn_mei

    At first I do like This => using System; using System.Collections.Generic; using System.Text.RegularExpressions; using Microsoft.CSharp; using Microsoft.SqlServer.Server; using System.Data; using System.Data.SqlClient; namespace AITania { class Program { //public static void InsertTrigger() //{ // SqlTriggerContext triggerContext = SqlContext.GetTriggerContext(); // SqlPipe sqlPipe = SqlContext.GetPipe(); // SqlCommand command = SqlContext.GetCommand(); // if (triggerContext.TriggerAction == System.Data.Sql.TriggerAction.Insert) // { // command.CommandText = "SELECT * FROM INSERTED"; // sqlPipe.Execute(command); // } //} static void Main(string[] args) { //---------------------------Database connection SqlConnection conn = new SqlConnection("Data Source=DIMENSION3000\\SQLEXPRESS; Initial Catalog=AITania; User Id=sa; Password=123456"); DataSet AlertDataSet = new DataSet(); SqlDataAdapter da; SqlCommandBuilder cmdBuilder; //--------------------------Open Connection conn.Open(); da = new SqlDataAdapter("SELECT * FROM AIEvent", conn); cmdBuilder = new SqlCommandBuilder(da); da.Fill(AlertDataSet, "AIEvent"); //-------------------------Displaying error foreach (DataRow dr in AlertDataSet.Tables[0].Rows) { Console.WriteLine("EventID: {0}", dr["EventID"]); Console.WriteLine("Time of Occur: {0}", dr["TimeOfOccur"]); Console.WriteLine("Location: {0}", dr["LocationID"]); Console.WriteLine(""); } Console.ReadLine(); //--------------------------Close Connection conn.Close(); //AIClass.AICheck.checkUserRole(); } } }

    C# csharp help tutorial question

  • how to do the sqlClr connection & deploy it in c# Express Edition?
    J jacklynn_mei

    oic...i have done the dataset but now the error is unhandled InvalidOperationException the error description is:-> The requested operation requires a SqlClr context, which is only available when running in the Sql Server process. I dont know how to use the SqlClr context how to write it in my code jac

    C# csharp help tutorial question

  • how to do the sqlClr connection & deploy it in c# Express Edition?
    J jacklynn_mei

    hem...so do u mean that i dont need the trigger function?...because i dont have any other way to get the real time data inserted in the database since the trigger function fired whenever any transaction made on that particular table. Before, i have done same thing that only using the dataset but if using the dataset i cant get the latest data (real time) inserted. regard Jac

    C# csharp help tutorial question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups