16,016,557 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Priya-Kiko (Top 78 by date)
Priya-Kiko
14-Dec-20 4:54am
View
As per @BillWoodruff, I went through their chat box and understood that their example will work only with Jquery 1.11 and Bootstrap 3 and that's exactly the same I have added as links. Will try mailing them too. Thanks
Priya-Kiko
14-Dec-20 4:22am
View
I have downloaded the Opensource version from the "GetPropeller" link on their website.
Priya-Kiko
30-Nov-20 2:12am
View
Thank you. Got it !
Priya-Kiko
31-Dec-19 0:55am
View
Got it ! Thank you so much for a crystal clear explanation.
Priya-Kiko
30-Dec-19 0:09am
View
Have got a very clear picture from your detailed explanation which also led to several further reading. Thanks a lot for that. Have removed the global context and as you suggested declaring it inside using () where ever database work is done. Thanks again.
Priya-Kiko
28-Dec-19 1:58am
View
Ok. Thank you.
Priya-Kiko
28-Dec-19 1:41am
View
Ok. Would you suggest me to get rid of the global Context altogether?
Is it not right to confine the global Context for just reading operations for reporting etc., and dispose it off finally on Exit while we use another local Context object inside using() for db Insert, Update and Delete ??
Now have changed the updation code like this :
DbUpdateJob_DoWork(object sender, DoWorkEventArgs e)
{
using (MyContext dbContext = new MyContext())
{
using (DbContextTransaction mdbtrans =
dbContext.Database.BeginTransaction(IsolationLevel.Serializable))
{
try
{
--- db operations with entityA - 1 ( Insert records )
DbUpdateJob.ReportProgress(20);
--- db operations with entityB - 2 ( Insert records)
DbUpdateJob.ReportProgress(40);
--- db operations with entityC - 3 (Update records )
DbUpdateJob.ReportProgress(60);
--- db operations wiwth entityD - 4 (Insert records)
DbUpdateJob.ReportProgress(80);
dbContext.SaveChanges();
mdbtrans.Commit();
DbUpdateJob.ReportProgress(100);
}
catch(Exception ex)
{
mdbtrans.Rollback();
DbUpdateJob.ReportProgress(0);
}
}
}
}
DbUpdateJob_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
pbupdate.Value = e.ProgressPercentage;
if (e.ProgressPercentage == 0)
MessageBox.Show(e.Message);
if (e.ProgressPercentage == 100)
MessageBox.Show("Success..!!");
}
After creating a local Context the rollback is perfectly fine. Thank you once again.
Priya-Kiko
28-Dec-19 0:46am
View
Thank you for throwing some light. The Context was indeed defined "Somewhere else" globally. As for the error reporting, we have an error handling routine in place. This is just a sample code.
Priya-Kiko
28-Dec-19 0:01am
View
Thanks for your response. I have missed out some lines while copying the code here... anyways the actual code has some exception in the db Operations 1 or 2 inside the try block.
Priya-Kiko
2-Jul-19 6:44am
View
Thank you. Those links are really useful and I was able to get a lot of information there. But my query is in the below block (From one of those links)
var contacts = new List<contact>();
for (int i = 0; i < 1000; i++)
{
var entity = new Contact
{
CustomerId = Guid.NewGuid(),
FirstName = "Ruben",
LastName = "Geers",
EmailAddress = "geersch@gmail.c
};
contacts.Add(entity);
}
In the above code, the column values in my case comes from another table. Is this the only way to explicitly list out the columns even if the table has 50 columns for ex.
Priya-Kiko
2-Jul-19 6:10am
View
Deleted
Thank you. Those links are really useful and I was able to get a lot of information there. But my query is in the below block of my question :
foreach(bills obj_bills in Context.bills)
{
mast_bills obj_mast_bills = new Context.mast_bills()
Context.mast_bills.Add{
// Here is there no other way than to list out the columns one by one //
billno = obj_bills.billno,
date = obj_bills.date,
----
-----
};
}
Priya-Kiko
2-Jul-19 1:47am
View
Thanks for your response.
What Im looking for is not a fast executing logic but the way of writing code. Is there no alternative like an object instead of listing the table columns while adding the record to another entity ???
Priya-Kiko
20-May-19 2:52am
View
Thank you for the response.
I understand that, any text, that we may want to suppress/show only while printing can be done, only when the print state can be trapped. While in preview mode, when user clicks on the 'Print' icon is there a way to capture that event?? If there is then any logic can be put in place. Looking for a solution on that grounds.
Priya-Kiko
11-Apr-19 3:47am
View
Thanks for the response. I tried doing this as you suggested :
IEnumerable<datarow> _query = from mobjbmast in Context.bmasts.AsEnumerable()
join mobjbtran in Context.btrans.AsEnumerable()
on mobjbmast.billno equals mobjbtran.billno
join mobjwaiter in Context.waiters.AsEnumerable()
on mobjbmast.scode equals mobjwaiter.code
where mobjbmast.billno == mbillno
select mobjbmast;
But it doesn't compile. How to construct the query please help.
Priya-Kiko
10-Apr-19 1:55am
View
Thank you for the response. Yes I did try with other data sources too adding AsEnumerable(). Yet the issue persisted.
Priya-Kiko
12-Mar-19 0:46am
View
Thank you for your time and suggestion.
Priya-Kiko
11-Mar-19 5:19am
View
Noted. Thanks again.
Priya-Kiko
11-Mar-19 1:41am
View
Thank you so much @BillWoodruff. Applying your suggestion I was able to achieve what I wanted exactly. Thanks again.
Well, 'noseats' denotes 'number of seats' against that table, for internal understanding.
I changed my code to :
Dictionary<string, int32=""> SeatsByTableID =
Context.seats.AsEnumerable()
.GroupBy(tbl => apputils.Left(tbl.code, tbl.code.Length - 1))
.ToDictionary(grp => grp.Key, grp => grp.Count());
Thank you for your time and help.
Priya-Kiko
11-Mar-19 1:27am
View
Thank you for the response.
Priya-Kiko
14-Feb-19 0:09am
View
Thanks :)
Priya-Kiko
3-Feb-19 8:25am
View
Thank you.
Priya-Kiko
1-Feb-19 0:58am
View
Thank you for your time and detailed explanation.
Priya-Kiko
21-Jan-19 3:11am
View
Deleted
One more thing, What if it runs on cloud sql ?
Priya-Kiko
21-Jan-19 3:07am
View
Thank you for a clear explanation. Thank you for your time.
Priya-Kiko
17-Jan-19 4:33am
View
I somehow got the below code generated by use CodeSnippetMember.
namespace EFCodeFirstTest
{
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.Spatial;
public sealed class Folio2
{
[Key]
public int RefNo { get; set; }
public int RecNo { get; set; }
}
}
But EF does'nt seem to recognize this as Primary key and when Im trying to do the migration it reports this error.
EFCodeFirstTest.RuntimeType: : EntityType 'RuntimeType' has no key defined. Define the key for this EntityType.
Priya-Kiko
17-Jan-19 4:23am
View
It returns this kind of code :
public sealed class Folio2
{
[("Key()")]
public int RefNo;
}
Priya-Kiko
16-Jan-19 23:27pm
View
ok.. no problem... That will not work.
Priya-Kiko
16-Jan-19 12:12pm
View
No ! EF does not recognize that as a Primary Key. I got this error during migration.
EFCodeFirstTest.RuntimeType: : EntityType 'RuntimeType' has no key defined. Define the key for this EntityType.
Priya-Kiko
16-Jan-19 11:46am
View
Thank you for the response. Tried changing the column name to ID, yet no luck !!
Priya-Kiko
16-Jan-19 11:44am
View
Thank you for the response @Maciej Los. I tried with the code you suggested. But the output is kind of like this :
namespace EFCodeFirstTest
{
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.Spatial;
public sealed class Folio2
{
[System.ComponentModel.DataAnnotations.KeyAttribute()]
public int RefNo;
}
}
Will this provide the [Key] functionality ?
Priya-Kiko
16-Jan-19 5:55am
View
Thank you so much, @Dave Kreskowiak, for a clear cut clarification and for routing to an apt link. Now will try with the same.
Priya-Kiko
12-Jan-19 6:50am
View
Ok. Thank you so much.
Priya-Kiko
12-Jan-19 5:20am
View
Thank you for the response.
The class which im trying to instantiate is a table class (or entity class) created by Entity Framework. Which class am i supposed to use as BaseClass here ??
Priya-Kiko
11-Jan-19 6:39am
View
Thank you.
Priya-Kiko
11-Jan-19 5:59am
View
Thanks, I understand, Its not with the date time or any condition, its just iam not able to use the CopyToDataTable extension.
Priya-Kiko
1-Dec-17 23:39pm
View
Oops...Overlooked that. Thank you so much for your time. That slash was indeed the trouble. Thank you again.
Priya-Kiko
18-Sep-17 1:44am
View
Thank you for the response.
This process is done on a daily basis, though I have specified 'Monthly' in my question. We have to transfer the day's transactions to a monthly backup file and clear off the day's tables. We use the month tables for reporting and the day tables for daily billing kind of transactions.
At the first, the month table may not be present. So we use :
if already present in sys.tables
insert into <monthtable> select * from <daytable>;
else
select * into <monthtable> from <daytable> ;
delete from <daytable>
This operation is done at the end of the day as part of a 'Day Close Process'
For Our operations, Solution 2 seems to be the only way out.
Priya-Kiko
18-Sep-17 1:25am
View
Thank you for the response.
The data in the source table(s) will be used in the day to day billing kind of transactions while the data in the target table(s) will not be accessed so frequently.
Hence we have adopted this logic to use the month files for reporting operations and clear the data in the day tables at the beginning of the day and use them in the transactions. This operation of transferring data from day table to month table happens day to day.
Further, we cannot specify the column names, since this operations happens for many tables and our function receives the table name as a parameter.
Priya-Kiko
6-Aug-16 7:51am
View
Thank you.
Priya-Kiko
6-Aug-16 6:33am
View
Thanks for the response. So it simply means to keep track of the images or such resources created in the form (not necessarily in form load) and Dispose them in the dispose event or close event right ?
Priya-Kiko
3-Aug-16 3:33am
View
Thank you.
Priya-Kiko
3-Aug-16 3:33am
View
Thank you so much. 5 stars to you.
Priya-Kiko
3-Aug-16 3:04am
View
Thank you so much.
msqldat.Close() is needed though :)
Priya-Kiko
3-Aug-16 2:51am
View
Thank you, So it is that I have to close the using block after msqldat.Close and then again open another using block for the next set of statements ?
Priya-Kiko
3-Aug-16 1:25am
View
Thank you,
So can my code be this :
DataTable dtbmast = new DataTable(),
DataTable dtkmast = new DataTable())
...
...
...
private void somefunction()
{
mconn.Open();
using (SqlCommand msqlcmd = new SqlCommand("select * from bmast", mconn)
{
using (SqlDataReader msqldat = msqlcmd.ExecuteReader())
{
dtbmast.Load(msqldat);
msqldat.Close();
msqlcmd.commandtext = "select * from kmast";
msqldat = msqlcmd.ExecuteReader(); // Here i get an error cannot assign to msqldat because it is in using statement
dtkmast.Load(msqldat);
msqldat.Close();
}
// Here msqldat is disposed off
}
// Here msqlcmd is disposed off
mconn.close();
}
// can use dtkmast and dtbmast here
Am I correct in understanding this and if this is inside try catch how does it work. Please help. Sorry for the trouble again and again.
Priya-Kiko
2-Aug-16 8:15am
View
Thank you so much. But then, even for the data tables used to load data into I think it has to be enclosed inside using() then what about their scope ?
Priya-Kiko
2-Aug-16 7:32am
View
Thank you for your reply.
In a situation like this where there are multiple statements next to next should i use it like this and what about the scope of the datatables. please help clarify. Thanks.
{
mconn.Open();
using (SqlCommand msqlcmd = new SqlCommand("select * from bmast", mconn),
SqlDataReader msqldat = msqlcmd.ExecuteReader(),
DataTable dtbmast = new DataTable(),
dtbmast.Load(msqldat),
msqldat.Close())
using (SqlCommand msqlcmd = new SqlCommand("select * from kmast", mconn),
SqlDataReader msqldat = msqlcmd.ExecuteReader(),
DataTable dtkmast = new DataTable(),
dtkmast.Load(msqldat),
msqldat.Close())
}
Priya-Kiko
2-Aug-16 7:07am
View
Thank you for the reply. That means 'command' has to be command.dispose() later on ?
Priya-Kiko
2-Aug-16 4:00am
View
Quite offensive though, Thank you for the reply.
Sorry, We are not professionals like you all and are just doing some R&D with stuff in the self learning process.
This code snippet is part of a class library the references of which i want to access from other forms and other dlls just like --- class.reference = something. ---- This is what I came across doing some reading.
Moreover, the sqlcommand is used in several places in several functions. Basically i need to have some light on how to implement the dispose pattern.
I need some light on this please :
1. Seems that a variable loses scope when it leaves out the block. Now I have figured this is okay with an Int or a String but not with SqlCommand or SqlDataReader etc.,
2. Now these unmanaged resources as they are called must be handled for disposing.
3. It is impractical to have a line ref.Dispose where ever such references are used considering my lack of knowledge on which are unmanaged resources and which are not.
4. At this background, i have figured this.. Dispose pattern and GC etc., which I dont know how to implement in my project.
5. Should I implement each and every class of my project from IDisposable and add a Dispose() method. If so I have to keep track of all the references used in the module to dispose them here isn't it.
Or just Form.Close or calling the destructor of the class can't do the job ?
Am i understanding this right. Please suggest.
Priya-Kiko
2-Aug-16 0:52am
View
Thank you for the reply.
In my case I have a main class (form) where i have written a common 'DrawItem' procedure like this to be used by all ownerdrawn listviews in other modules in my project :
public static void lvDrawItem(object sender, DrawListViewItemEventArgs e, String[] str, Int32[] x)
{
Font myfont = new Font("Segoe UI", 12);
for (int mi = 0; mi < str.Length; mi++)
e.Graphics.DrawString(str[mi], myfont, PopUpTextColor, new Point(e.Bounds.X + x[mi], e.Bounds.Y));
if ((e.State & ListViewItemStates.Focused) == ListViewItemStates.Focused)
{
e.Graphics.FillRectangle(PopUpSelectedItemBackColor, e.Bounds);
for (int mi = 0; mi < str.Length; mi++)
e.Graphics.DrawString(str[mi], myfont, PopUpSelectedItemForeColor, new Point(e.Bounds.X + x[mi], e.Bounds.Y));
}
}
So in this case I have a doubt how myfont will get disposed.
Im actually stuck with figuring out a solution for 'Error creating window handle'. In the process I figure the Fonts which im using in the loop for listview all over the project might be eating up the memory.
Please clarify.
Priya-Kiko
2-Aug-16 0:41am
View
Thank you 0x01AA.
Priya-Kiko
1-Aug-16 8:10am
View
Thank you for the reply.
I referred that. My doubt is should every line contain a Dispose() like this :
{
Font myFont = new Font("Arial",12);
.... some code with myFont
myFont.Dispose();
myFont = new Font("Times New Roman", 8);
.... some other code with myfont
myfont.Dispose();
.
.
.
}
or is it enough if i do myFont.Dispose() just at the end once.
Please clarify.. Thanks
Priya-Kiko
7-Jan-16 4:45am
View
Thanks a lot. Was able to get it resolved through your directions. Thanks again.
Priya-Kiko
6-Jan-16 23:49pm
View
Thank you professional. I have changed my app.config as you have told. The code after changing is as below.
runtime
assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"
dependentAssembly
assemblyIdentity name="acc"
codeBase href="file://192.168.0.1\soft$\mydlls\acc.dll"
assemblyIdentity name="adm"
codeBase href="file://192.168.0.1\soft$\mydlls\adm.dll"
dependentAssembly
assemblyBinding
runtime
Here 192.168.0.1 is my server's IP and soft$ is a volume share name and mydlls is a directory in that location. I can view the directory listing when I click on that link.
In my project for the dlls I have given 'Copy Local' as false and generated the exe. Don't know if I'm on the right track. The exe is not finding the dlls from that location. Please help. Thanks in advance.
Priya-Kiko
6-Jan-16 4:59am
View
I tried this code in App.Config for my 2 dlls. acc.dll and adm.dll. It doesn't seem to work. Have I got the syntax right. Please advise. Thanks. (Not able to submit with tags here.)
runtime
assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"
dependentAssembly
assemblyIdentity name="acc"
codeBase href="h:\mydlls\acc.dll"
assemblyIdentity name="adm"
codeBase href="h:\mydlls\adm.dll"
dependentAssembly
assemblyBinding
runtime
Priya-Kiko
6-Jan-16 4:56am
View
Deleted
I tried this code in App.Config
<runtime>
<assemblybinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentassembly>
<assemblyidentity name="acc">
<codebase href="h:\mydlls\acc.dll">
<assemblyidentity name="adm">
<codebase href="h:\mydlls\adm.dll">
But doesn't seem to work. Please help. Thanks.
Priya-Kiko
6-Jan-16 4:16am
View
Thank you, I will try it and get back.
Priya-Kiko
6-Jan-16 4:08am
View
Deleted
I tried the below code (as found in MSDN, only path changed) in app.config :
<configuration>
<runtime>
<assemblybinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="bin;h:\mydlls"/>
This did not work for me. Please help.
Priya-Kiko
6-Jan-16 3:57am
View
Thanks for your quick response.
If I have have more than 1 dll then should there be an entry for each and every dll and is the publicKeyToken mandatory. Please advise.
Priya-Kiko
2-Mar-15 1:04am
View
Thanks for your response. I overlooked that. My mistake. Sorry for wasting your time. Thanks agains.
Priya-Kiko
28-Feb-15 6:43am
View
Thanks for the response.
I am iterating through all columns in my DataGridView using a for loop and checking if that Columns[counter].Frozen == true.
Priya-Kiko
7-Feb-15 2:25am
View
Thank you So much.
I worked on that and got lot of things cleared. Thanks again.
Priya-Kiko
6-Feb-15 6:55am
View
Thanks for the immediate response.
When TAB key is pressed, I want to disable the gridview and proceed with updation code.
Sorry Edited :
void txtrate_KeyDown(object sender, KeyEventArgs e)
{
MessageBox.Show(MyCustomControls.GridViewForKeyPress.KeyPressed.ToString());
}
Priya-Kiko
2-Feb-15 4:49am
View
Thank you so much.
Priya-Kiko
2-Feb-15 4:38am
View
The code to move the focus :
private void cbTest_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Up)
{
if (cbTest.DroppedDown)
return;
else
{
txtTest.Focus();
}
}
}
Priya-Kiko
30-Jan-15 3:11am
View
Please excuse any code in-discipline. I am still in the learning process.
This is not a commercially usable code, but can give idea to people looking for similar solution.
This code was intended to generate a textbox control with the similar functionality as a visual FoxPro textbox for numeric values especially.
Priya-Kiko
28-Jan-15 5:36am
View
Thanks for your reply. I wanted to add the space in place of the deleted character and not as an extra character....
Priya-Kiko
28-Jan-15 3:13am
View
Thank you for the response.
Yes, but I can build a new string accordingly, only if I know the position of the char removed.
Priya-Kiko
24-Jan-15 6:01am
View
Thanks a lot. That is exactly what I had to do. Thank you so much.
This solution works very well with a masked text box with PromptChar = space. Exactly what I wanted. Thanks.
Priya-Kiko
24-Jan-15 5:42am
View
Validating the input is a post operation, which anyway has to done. But, can nothing be done during the input?
I thought I could capture the ASCII 46 in the Keypress and move the cursor after the decimal point and would format the integer portion of the text to take care of the abnormalities. Anyway, at the foreground user feels the input friendly.
Is my approach wrong. Please advice.
Priya-Kiko
24-Jan-15 5:30am
View
Thanks for the reply.
Not the second decimal point. I just want to move the cursor next to the decimal point for the user to key in the fraction part.
Priya-Kiko
24-Jan-15 5:22am
View
Sorry if my question was confusing. :)
I tried using the NumericUpDown control.
The control is first initialized to 0.00 where I have set the decimals to 2.
When user keys in a value like 365.40, he/she has to delete the 0's and the decimal point in there already. Which is what I want to avoid.
Priya-Kiko
24-Jan-15 4:56am
View
Thanks for your immediate reply.
Iam not accepting two values. But a (Double) value. Rate of an item like 500.00, 350.50.
Priya-Kiko
17-May-14 7:36am
View
Thanks for immediate response. The hidden field is set at client side and i have to assign it in the client side itself.
Priya-Kiko
28-Apr-14 2:41am
View
Thanks Tadit, I have accepted this as solution gladly. :)
Priya-Kiko
26-Apr-14 6:54am
View
Thanks a million !
It worked very well.
Priya-Kiko
25-Apr-14 6:21am
View
We tried it and got this error while building :
Unrecognized attribute 'requestValidationMode'. Note that attribute names are case-sensitive.
Priya-Kiko
25-Apr-14 5:56am
View
Thanks for your immediate response.
This line returns an error in my Web.config.
Show More