Click here to Skip to main content
14,600,877 members

Comments by Golden Basim (Top 200 by date)

Golden Basim 4 days ago View
   
i tried many times , The required Query is complex. and the result still not the valid data.
can i post my code to review it? thanks
Golden Basim 27-Jul-20 13:13pm View
   
this class contains 4000 line maybe 80-100 var, var name is Query name, var value is Query Text ex:-
// get Shortages count
public static string getItems_Shortages_Count_QUERY = @"
CREATE PROCEDURE `getItemsShortagesCount`(in searchVar varchar(200))
BEGIN
Select * from st_items s, st_plug_manufacturer m where stitems_Name LIKE CONCAT('%', searchVar , '%') or
s.stitems_Pharma_ActiveIngredient LIKE CONCAT('%', searchVar , '%') or
m.manu_Name LIKE CONCAT('%', searchVar , '%') or
s.stitems_Code =searchVar;
END ";
Golden Basim 27-Jul-20 9:25am View
   
Yes, I thought about that before but this variables already was called in many other locations. but still your solution is the best for new projects. thanks
Golden Basim 26-Jul-20 11:35am View
   
yes this in case i know what is the variable that the user will call it. the user will write just variable name in textbox.text = var1
Golden Basim 23-Jul-20 12:09pm View
   
h guess that the issue not related to the code , because i tested the code on other printer and it work. .. ok i will improve the qst. thanks
Golden Basim 4-Jul-20 15:33pm View
   
thank you, I've read the article. but i still can't know how to call function not a pro.
Golden Basim 6-Jun-20 17:09pm View
   
now i improved my code , using App.config file to store the connection also i Encrypted it, is my code now clean ?
public mrsalesdbEntities()
            : base(Functions.ConvertHashToText(ConfigurationManager.ConnectionStrings["mrsalesdbEntities"].ConnectionString))
        {
        }
Golden Basim 6-Jun-20 9:52am View
   
Deleted
System.ArgumentException: 'Keyword not supported: 'server'.'

    <add name="mrsalesdbEntities" connectionString="metadata=res://*/MrSModels.MrSalesModel.csdl|res://*/MrSModels.MrSalesModel.ssdl|res://*/MrSModels.MrSalesModel.msl;provider=MySql.Data.MySqlClient;provider connection string="server=localhost;user id=***;password=***;characterset=utf8;convertzerodatetime=True;port=3309;database=****"" providerName="System.Data.EntityClient" />
Golden Basim 5-Jun-20 19:08pm View
   
no, i stored it into Encrypted conn.txt, but still inscure because it will loaded on memory so i will read this article because i prefer putting connection string into config file. , how to edit the connection string in the config file with code at runtime ?
Golden Basim 5-Jun-20 16:36pm View
   
i want the user can change the connection with UI , also if the connection string in the App.config file will be insecure and any developer can access the database.
Golden Basim 5-Jun-20 16:00pm View
   
hi, yes i use this approach usually, i changed this line as you suggest :

 string mrsales_Coonn = string.Format("SERVER={0};Port={1};DATABASE={2};UID={3};PASSWORD={4};{5};charset={5};Connect Timeout=1999999;", server, port, database, uid, password, OPTION , charset); 

but it seem that EntityConnection have another diffrent format because it can't read "Port","convert zero datetime","charset". can you guide me please how to write this connection string?
Golden Basim 5-Jun-20 16:00pm View
   
hi, yes i use this approach usually, i changed this line as you suggest :

 string mrsales_Coonn = string.Format("SERVER={0};Port={1};DATABASE={2};UID={3};PASSWORD={4};{5};charset={5};Connect Timeout=1999999;", server, port, database, uid, password, OPTION , charset); 

but it seem that EntityConnection have another diffrent format because it can't read "Port","convert zero datetime","charset". can you guide me please how to write this connection string?
Golden Basim 2-Jun-20 9:08am View
   
i updated my context file to

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated from a template.
//
//     Manual changes to this file may cause unexpected behavior in your application.
//     Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace MrSales.MrSModels
{
    using System;
    using System.Data.Entity;
    using System.Data.Entity.Infrastructure;
    using System.Data.Entity.Core.Objects;
    using System.Linq;
    using System.Data.Common;


    public partial class mrsalesdbEntities : DbContext
    {
        public mrsalesdbEntities()
            : base("name=mrsalesdbEntities")
        {
        }


        public mrsalesdbEntities(DbConnection existingConnection, bool contextOwnsConnection)
            : base(existingConnection, contextOwnsConnection)
        {
        }


        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            throw new UnintentionalCodeFirstException();
        }
    
        public virtual DbSet<account_items> account_items { get; set; }


also i updated the app.config file to:

<entityFramework codeConfigurationType="MrSales.MrSModels.mrsalesdbEntities, MrSales.MrSModels">


but this error appear :
The DbConfiguration type 'MrSales.MrSModels.mrsalesdbEntities, MrSales.MrSModels' specified in the application config file could not be loaded. Make sure that the assembly-qualified name is used and that the assembly is available to the running application. See http://go.microsoft.com/fwlink/?LinkId=260883 for more information.'
Golden Basim 1-Jun-20 13:35pm View
   
i use this function to set custom connection parameters
public static mrsalesdbEntities OpenConn()
        {
            mrsalesdbEntities MrSalesContext = new mrsalesdbEntities();
            MrSalesContext.Database.CommandTimeout = 999999;
            MrSalesContext.ChangeDatabase
               (
                   initialCatalog: myconn.database,
                   port: Convert.ToUInt32( myconn.port),
                   userId: myconn.uid,
                   password: myconn.password,
                   dataSource: myconn.server
            );
            return MrSalesContext;
        }

mrsalesdbEntities DB1 = ConnectionTools.OpenConn();
Golden Basim 11-May-20 11:21am View
   
Yes, your words are logical, I will actually do it, but I would also like to know the reason why the value is inserted wrongly in databases
Golden Basim 11-May-20 11:19am View
   
no , this code just insert wrong value
Golden Basim 9-May-20 17:35pm View
   
i putted break point after this line
 SS.fiscal_year_end = NewYear_end;
and i fount that the both ss.fiscal_year_end or NewYear_end have this value 31/12/2021 11:59:59 PM
Golden Basim 25-Apr-20 14:49pm View
   
it work when i modified the Model and setting stitems_ID Entity Key property to true
Golden Basim 17-Mar-20 15:04pm View
   
thank you , i already did that but as you know i can't see the the design without run the program. so it's difficult and take long time.
Golden Basim 21-Feb-20 17:21pm View
   
Deleted
please check the video https://vimeo.com/user108867897/review/393052462/261b10e2d4
Golden Basim 21-Feb-20 17:21pm View
   
Deleted
please check https://vimeo.com/user108867897/review/393052462/261b10e2d4
Golden Basim 21-Feb-20 16:33pm View
   
gridView1.FocusedRowHandle = 0 , BasicVars.DeafulStore = 1 ,storeID is a correct.
Golden Basim 21-Feb-20 16:13pm View
   
i did that , the line
gridView1.SetRowCellValue(gridView1.FocusedRowHandle, "storeID", BasicVars.DeafulStore);
and there is no any null object
Golden Basim 13-Feb-20 18:21pm View
   
i'm sorry "In the same .ICO file. A .ICO file can have many images in it." i will search for that ..thanks
Golden Basim 13-Feb-20 12:45pm View
   
What I understood from the article is that I should put more versions of the icon (all sizes) in my program , but where do I put those icons !!
Golden Basim 4-Feb-20 12:39pm View
   
i already did that i write the both
Golden Basim 10-Jan-20 11:28am View
   
i asked to get HDD serial ,but after i tried it a get this issue now i need to get the unique serial for the primary Hard driver that contains (windows OS)
Golden Basim 1-Nov-19 6:10am View
   
sorry , i updated the question
Golden Basim 1-Nov-19 6:10am View
   
sorry , i updated the question
Golden Basim 31-Oct-19 18:38pm View
   
i have online system which auto generate the license after payment process. also i linked my software with the licensing system using API. thanks
Golden Basim 28-Oct-19 16:27pm View
   
yes , the activation occur from the software and affect my website (online system) and i can enable another option to make the customer cam mange its license and devices
Golden Basim 28-Oct-19 10:24am View
   
thank you , i think that i will combine HDD SerialNumber & ProcessorID and MotherBoard Serial.
Golden Basim 28-Oct-19 6:35am View
   
private void GetAllDiskDrives()
    {
        var searcher = new ManagementObjectSearcher("SELECT * FROM Win32_DiskDrive");

        foreach (ManagementObject wmi_HD in searcher.Get())
        {
            HardDrive hd = new HardDrive();
            hd.Model = wmi_HD["Model"].ToString();
            hd.InterfaceType = wmi_HD["InterfaceType"].ToString();
            hd.Caption = wmi_HD["Caption"].ToString();

            hd.SerialNo =wmi_HD.GetPropertyValue("SerialNumber").ToString();//get the serailNumber of diskdrive

            hdCollection.Add(hd);
        }

 }

i think SerialNo is a hardware serial ????
Golden Basim 28-Oct-19 5:28am View
   
i can't use dongle because of the location of my customers. if i used HDD serial no. , the serial will change with formatting disk ?
Golden Basim 23-Sep-19 9:58am View
   
hi, thanks for your answer :
1 what to do with leading zeroes : xxxx09 should become xxxx10 or xxxx0010
xxxx09 should become xxxx10

2 xx23yyy or 23xxx : xx24yyy or 24xxx ?
no it should become xx23yyy1 , 23xxx2 ,also xx23yyy99 should become xx23yyy100

3 what if the string contains no digits ?
Abcdf should become Abcdf0

how to achieve that ?
Golden Basim 22-Sep-19 15:26pm View
   
but this issue don't happen with any string contains Letter like (00501C2326) , how to determine that
Golden Basim 25-Aug-19 8:06am View
   
i tried that using Advanced Installer and the same error appeared (all files in bin dir. was copied). also some times i need to send quick updates to my customers. as example the last update i edited simple code without using any extra components or tools.
Golden Basim 25-Aug-19 6:56am View
   
i did that already , but it work without any errors
Golden Basim 25-Aug-19 6:48am View
   
customer use Windows 7 , this error did't appear on 100% of windows 10.
this error appear only on windows 7 sp1.
Golden Basim 25-Aug-19 6:04am View
   
Is there any possibility that the problem is related to Windows and not the code? That's where the program didn't start working.
Golden Basim 12-Jul-19 6:51am View
   
i i have stock with two different expired date (same item) , i should to create two record in "Inventory" ?
Golden Basim 11-Jul-19 5:34am View
   
in sales operation ?
Quantity = Quantity - @Adjusment
Golden Basim 31-May-19 9:47am View
   
thank you i will try it now
Golden Basim 31-May-19 9:44am View
   
thank you , it will affect the performance ?? ,, i use skip() to fetch only limited records if i used .AsEnumerable() it will fetch all the records before Skip() ?
Golden Basim 30-May-19 12:47pm View
   
i'm sorry but this not clear for me.. the results have thousands of records that have Hundreds of types (that need to translated)
Golden Basim 30-May-19 5:09am View
   
thanks , how to do your that without affect performance. i stored the results in this list
List<CLSItemsHistory> dList = new List<CLSItemsHistory>();
Golden Basim 24-May-19 15:32pm View
   
how to do that and show the sum() within the columns ? please can you give me example
Golden Basim 16-May-19 12:47pm View
   
yes i know , i just want to avoid repeating catch statement in every code and every window
Golden Basim 16-May-19 12:27pm View
   
the exception maybe appear in the loading of the program , and maybe appear during the work
Golden Basim 16-May-19 12:26pm View
   
same exception but it appear many times , so i want to replace it with a custom msgbox , user see this exception and think that the program was crashed
Golden Basim 16-May-19 12:26pm View
   
Deleted
same exception but it appear many times , so i want to replace it with a custom msgbox , user see this exception and think that the program was crashed
Golden Basim 15-Apr-19 17:56pm View
   
also i tried to re add the stored procedure , in "manage Stored Procedures" window i clicked on Preview and the same error appear

Data loading failed because the Exception occurred
Ambiguous match found.
Golden Basim 15-Apr-19 17:46pm View
   
This error appears as soon as you add the stored Procedure
Golden Basim 15-Apr-19 8:11am View
   
thank you
Golden Basim 8-Apr-19 5:23am View
   
The left-hand side of an assignment must be a variable, property or indexer
Golden Basim 4-Apr-19 10:40am View
   
it work thank you
Golden Basim 4-Apr-19 4:49am View
   
0) i checked that during debugging
 FirstDayOfMonth =  {01/04/2019 12:00:00 ص} LastDayofMonth = {30/04/2019 12:00:00 ص} <pre>
1) Yes, i did a foreach BEFORE i get to .Where(), and the data have the same problem.( it repeat the first and second record twice , I have 4 record in the VIEW)
Golden Basim 3-Apr-19 14:57pm View
   
the data is correct i checked it using workbench
Golden Basim 3-Apr-19 14:14pm View
   
yes i'm sure
Golden Basim 3-Apr-19 13:45pm View
   
the problem with the query ..i checked the query in foreach to see the result for every record ..
Golden Basim 12-Mar-19 5:59am View
   
Error CS1955 Non-invocable member 'Control.Controls' cannot be used like a method.
Golden Basim 11-Mar-19 8:42am View
   
thanks
also i tried this code to check if the from have an issue or no >>


frm.Close();



and

frm.text = "change text";

and the code don't run , no thing happen no errors appear
Golden Basim 11-Mar-19 6:03am View
   
i tried that but i failed
ComboBoxEdit PAG_CountPerPage = frm.Controls["PAG_CountPerPage"] as ComboBoxEdit;
            PAG_CountPerPage.SelectedIndex = 3;
Golden Basim 11-Mar-19 5:05am View
   
please can you show , how i can to do that ?
Golden Basim 11-Mar-19 5:04am View
   
i'm sorry maybe i failed to explain what i want .. what i want is like that
 frm.Controls["PAG_CountPerPage"].EditValue = ""; 
Golden Basim 9-Mar-19 9:01am View
   
please , what is your suggestion ?
Golden Basim 8-Mar-19 12:06pm View
   
this issue happen when i click on any location in the form but it does not happen if i used only barcode reader
Golden Basim 7-Mar-19 9:42am View
   
thank you ..
i don't know why ProcessCmdKey don't read the code successfully ..

i tried to scan this code (3PZ.55.24861456.17) but the result was ( 33PZ¾55¾24861456¾17) ..
Golden Basim 7-Mar-19 6:48am View
   
i tried to scan this code (3PZ.55.24861456.17) but the result was ( 33PZ¾55¾24861456¾17)
Golden Basim 7-Mar-19 6:05am View
   
it work :
code = code.Replace("\r\n", "").Replace("\r", "").Replace("\n", "");

still can't read character ..
Golden Basim 7-Mar-19 6:02am View
   
i used this code.ToString().TrimEnd('\r');
but result still :
4063717659543\r
Golden Basim 7-Mar-19 5:36am View
   
i did that but it read ENTER key within the code so like that :
this code " 4063717659543
" does not exist!
Golden Basim 7-Mar-19 5:32am View
   
"also another issue , i scanned this code (4063717659543) , it work will but when i tried to scan it another , the result was (44063717659543) ... why it add (4) in the start ?"

this issue happen only if the row which added in the gridview have an errors , so i thing the rest of the code don't run .. but i don't know why i can solve that
Golden Basim 7-Mar-19 5:00am View
   
also another issue , i scanned this code (4063717659543) , it work will but when i tried to scan it another , the result was (44063717659543) ... why it add (4) in the start ?
Golden Basim 7-Mar-19 4:58am View
   
thank you , it work but why i make it accept character and symbols like (-,/,.,...) not just number ..
i tried to scan this code (3PZ.55.24861456.17) but the result was ( 33PZ¾55¾24861456¾17)
Golden Basim 7-Mar-19 4:11am View
   
thank you for your answer... i want to know how to run "ProcessCmdKey" whene my barcode reader begin to work ? which event i can to use ?

thanks
Golden Basim 26-Feb-19 12:26pm View
   
thanks for comment ..
please help me to understatnt that .. i should to group with all colmuns ? as :
GROUP BY items.stitems_ID, ca.NOSStoreID,unitsdet.DetunitID,ca.Amount;
Golden Basim 2-Jan-19 11:28am View
   
:)
Golden Basim 2-Jan-19 11:26am View
   
thank you ... yes that what i mean ..
it work after replace "acm.accitem_PeplID" instead of "crs.accitem_PeplID"
thanks
Golden Basim 29-Dec-18 13:58pm View
   
thanks :)
Golden Basim 29-Dec-18 6:55am View
   
i tested it with real values .. it is work very very very good .. thank you i will build many VIEWs based on you query ,,, so what you suggest it will be good if i select * from this view with EF or i should to use Stored Procedure also ?
Golden Basim 29-Dec-18 4:56am View
   
i have error with syntax again in (LEFT ,and SUM) , i use MySQL server 5.7.21

CREATE OR REPLACE VIEW `shortages` as
SELECT si.stitems_ID,
si.stitems_MinBalance,
COALESCE(ca.Amount + pa.Amount,0) AS Stock
FROM st_items si,
LEFT JOIN (SELECT sns.stitems_ID,
SUM(sns.StockQnty) AS Amount
FROM stock_noserials sns
GROUP BY sns.stitems_ID) ca
ON ca.stitems_ID = si.stitems_ID
LEFT JOIN (SELECT pis.stitems_ID,
COUNT(*) AS Amount
FROM purchases_item_seriels pis
WHERE pis.pis_Statues IN (1, 5, 6)
GROUP BY pis.stitems_ID) pa
ON pa.stitems_ID = si.stitems_ID
WHERE COALESCE(ca.Amount + pa.Amount, 0) < si.stitems_MinBalance;
Golden Basim 29-Dec-18 4:53am View
   
yes the last query i think that it what i mean .. i will try it now
thanks
Golden Basim 28-Dec-18 16:43pm View
   
thanks for reply , 1- it say unexpected 'with' (with)
2- i went to this table "purchases_item_seriels" to your query
Golden Basim 28-Dec-18 15:43pm View
   
thank you , i checked this documentation and others .. but i can't create the required query
Golden Basim 28-Dec-18 14:08pm View
   
thank you ..
Golden Basim 27-Dec-18 14:41pm View
   
thank you , i have many queries like this so i will convert them to "stored procedure" and " VIEWs ", but i'm not prefect in that , can you please i know example for one of my codes !?
Golden Basim 27-Dec-18 14:41pm View
   
thank you , i have many queries like this so i will convert them to "stored procedure" and " VIEWs ", but i'm not prefect in that , can you please i know example for one of my codes !?
Golden Basim 26-Nov-18 11:26am View
   
thank you , it work after changing to .Select(u => new { u.pis_ExpireDate }) thanks
Golden Basim 26-Nov-18 6:50am View
   
i need to show only list of expired dates in Gridview , i use this line to define the first column field name :
gridView3.Columns[0].FieldName = "pis_ExpireDate";
Golden Basim 25-Nov-18 13:25pm View
   
i tried that and same result

// if this serial is new
var NewSerialresList = CreatedSerials.Where(u => u.Item4 == VID && u.Item7 == 0).ToList();
if (NewSerialresList.Count() > 0)
{


var ss = new List<purchases_item_seriels>();

foreach (var r in NewSerialresList)
{
try
{
//var DBs002 = ConnectionTools.OpenConn();
mrsalesdbEntities DBs002 = new mrsalesdbEntities();
var purchasesItemSerials = new purchases_item_seriels()
{
pitem_ID = pitem_ID,
stitems_ID = r.Item1,
pmain_ID = PurchasesID,
pitem_virtualID = r.Item4,
pis_CustomSerial = r.Item2,
pis_ExpireDate = r.Item3,
pis_Statues = 0,
ss_StoreID = Convert.ToInt32(gridView1.GetRowCellValue(ItemImdex, "storeID")),
Purchases_Price = Convert.ToDecimal(gridView1.GetRowCellValue(ItemImdex, "item_NetSmallestUnitPrice")),
};
//ss.Add(purchasesItemSerials);
DBs002.purchases_item_seriels.Add(purchasesItemSerials);
DBs002.SaveChanges();
}
catch (Exception ex)
{
Msg.Show("", ex.ToString(), 0);
}

}


}
Golden Basim 25-Nov-18 7:54am View
   
public static mrsalesdbEntities OpenConn()
{
mrsalesdbEntities MrSalesContext = new mrsalesdbEntities();
MrSalesContext.ChangeDatabase
(
initialCatalog: myconn.database,
port: Convert.ToUInt32( myconn.port),
userId: myconn.uid,
password: myconn.password,
dataSource: myconn.server
);
return MrSalesContext;
}

var DBs350 = ConnectionTools.OpenConn();
Golden Basim 25-Nov-18 4:55am View
   
no 'ss' have 2 record ( count of the new records).
Golden Basim 6-Nov-18 8:38am View
   
the balance value show only one record not the sum of all records for same item
Golden Basim 11-Sep-18 13:42pm View
   
please check the first log (5.7.21)
Golden Basim 11-Sep-18 13:37pm View
   
how i can check it ?
Golden Basim 11-Sep-18 13:37pm View
   
Deleted
i tried all , but same issue occurs
Golden Basim 11-Jun-18 10:26am View
   
thank you bro ::
Golden Basim 11-Jun-18 8:37am View
   
this work , thanks
int Shortages_StockNoSer = nDB01.stock_noserials
.GroupBy(x => x.stitems_ID)
.Select(grp => new
{
itemID = grp.Key,
sum = grp.Sum(x => x.StockQnty),
min = grp.Select(s => s.st_items.stitems_MinBalance).FirstOrDefault()
}).Where(u => u.sum < u.min && u.min != 0)
.Count();
Golden Basim 6-Jun-18 17:24pm View
   
as the code in login form (above) it reached at "return; " and login form was closed , home form appeared
Golden Basim 5-Jun-18 19:00pm View
   
i have an issue :
private void btnLogin_Click(object sender, EventArgs e)
{
if(txtUserName.Text=="admin" && txtPassword.Text=="pass")
{
MessageBox.Show("Login Successful");
this.Close();
}
else
{
MessageBox.Show("Login Failed");
return;

}
}
but the both of conditions show home form ..
Golden Basim 17-Mar-18 11:53am View
   
ok thank you
Golden Basim 17-Mar-18 11:28am View
   
thank you.
I can import/export it successfully from Workbench (MySQL server 5.7.21 ).

also when I deleted a stored procedure, I could import it successfully.

all of the stored procedure like this :

CREATE DEFINER=`root`@`localhost` PROCEDURE `getItemsDataByID`(in ID int)
BEGIN
SELECT * FROM st_items where stitems_ID=ID;
END
Golden Basim 21-Feb-18 9:10am View
   
what I need to make user install it with my application easy
Golden Basim 21-Feb-18 8:39am View
   
I tried to install MySQL server with the advanced installer but I failed more times.
Golden Basim 21-Feb-18 8:31am View
   
i tried that with advanced installer
as this post
https://www.advancedinstaller.com/forums/viewtopic.php?f=2&t=21072&sid=f168367743c73f2972865634d11ef5bd

and itried another aproache :
https://www.advancedinstaller.com/forums/viewtopic.php?f=2&t=35086

but the same error appear
Golden Basim 21-Feb-18 5:49am View
   
i update the code :
string appPath = Path.GetDirectoryName(Application.ExecutablePath);
String path = String.Format("/assemblypath={0}", appPath + @"\mysql\bin\mysqld");

the error :
System.InvalidOperationException: 'Cannot start service mysqlTests on computer '.'.'
Win32Exception: The service did not respond to the start or control request in a timely fashion
Golden Basim 21-Feb-18 5:38am View
   
"mysql\bin\mysqld.exe"
Golden Basim 21-Feb-18 5:38am View
   
yes ..

"mysql\bin\mysqld.exe"
Golden Basim 20-Feb-18 18:25pm View
   
i don't know where ( administrative panel) but in mysql service properties the path don't contain .exe
Golden Basim 6-Feb-18 17:16pm View
   
it seam that the error here
//Context.purchases_item.RemoveRange(Context.purchases_item.Where(u => u.pmain_ID == PurchasesID));
//Context.SaveChanges();
but i don't know what is ?
Golden Basim 6-Feb-18 17:04pm View
   
by using this steps i found the value of "a" in the first line = 1500 (correct value)
but the last is empty. ( i use the this code to remove old items data)
a = "";
for (int i = 0; i < gridView1.DataRowCount; ++i)
{
a = Convert.ToString(gridView1.GetRowCellValue(i, "stitems_ID")) + " / ";
}
// remove Old Items
Context.purchases_item.RemoveRange(Context.purchases_item.Where(u => u.pmain_ID == PurchasesID));
Context.SaveChanges();
//// remove Old Serials
Context.purchases_item_seriels.RemoveRange(Context.purchases_item_seriels.Where(u => u.pmain_ID == PurchasesID));
Context.SaveChanges();
a = "";
for (int i = 0; i < gridView1.DataRowCount; ++i)
{
a = Convert.ToString(gridView1.GetRowCellValue(i, "stitems_ID")) + " / ";
}
Golden Basim 6-Feb-18 16:56pm View
   
Deleted
i put breakboint , it's return zero value not the selected value.
Golden Basim 6-Feb-18 16:54pm View
   
Deleted
i put breakpoint at this line and it's value 0
Golden Basim 6-Feb-18 16:53pm View
   
Deleted
i put breakpoint at this line , it return zero value not the selected value.
Golden Basim 6-Feb-18 14:26pm View
   
data loaded from mysql database to gridview successfully and right value appear in repositoryitemlookupedit , but during the update operation Convert.ToInt32(gridView1.GetRowCellValue(ItemImdex, "stitems_ID")) return zero value not the selected value.
Golden Basim 3-Feb-18 15:44pm View
   
I don't know what I can write instead of "if (ac.GetType() ==)
".
Golden Basim 28-Jan-18 15:11pm View
   
Deleted
Regex regex = new Regex("(?<="+ startsWith +"\\s*=\\s*)"+ OldVar+"(?=\\$)",
RegexOptions.Multiline
| RegexOptions.Singleline
| RegexOptions.CultureInvariant
| RegexOptions.Compiled
);
Golden Basim 28-Jan-18 15:03pm View
   
Deleted
thanks , how can i replace "SERVER" and "Localhost" with variables
Golden Basim 27-Jul-17 16:57pm View
   
Deleted
ok, thanks..
don't want to install wamp server on my customer PC , so what is the correct software to install it :
MySQL Community Server (GPL)
MySQL Cluster (GPL)
MySQL Router (GPL)
MySQL Utilities (GPL)
New! MySQL Shell (GPL)
MySQL Workbench (GPL)
MySQL on Windows (Installer & Tools)
MySQL Yum Repository
MySQL APT Repository
MySQL SUSE Repository
or others ?
Golden Basim 27-Jul-17 16:51pm View
   
ok thank you..
i don't want to install WAMP Server on my customer PC.. so what is the correct version of MySQL server to install it ?
i searched and found :
MySQL Community Server (GPL)
MySQL Cluster (GPL)
MySQL Router (GPL)
MySQL Utilities (GPL)
MySQL Shell (GPL)
MySQL Workbench (GPL)
MySQL on Windows (Installer & Tools)
MySQL Yum Repository
MySQL APT Repository
MySQL SUSE Repository
Golden Basim 27-Jul-17 6:02am View
   
that is what i need .
i need my application work on network , but all client computers can't access the database when the copy(my application) which installed on the server PC is closed.

"You do not install it as part of your app" OK ,but i need the best version to install it side by side my application without any hard steps to install it.( i will install it only in the main pc).
Golden Basim 26-Dec-16 13:40pm View
   
yes ..
i need to make like this
http://joomtraining.com.au/assets/categoryManager.jpg
Golden Basim 26-Dec-16 13:33pm View
   
what i do to show them in table ? ( like joomla categories page )
Golden Basim 8-Feb-16 14:15pm View
   
i updated the question with some data , please check it.
Golden Basim 21-Dec-15 13:15pm View
   
i don't know how i can write it
Golden Basim 21-Dec-15 12:57pm View
   
i updated my Questions to explain what i went
Golden Basim 21-Dec-15 12:48pm View
   
my database have sales table and purchase table , i went to show the two table in data grid veiw sorting by date field
Golden Basim 21-Dec-15 10:55am View
   
i can't write code to do that
Golden Basim 2-Dec-15 17:27pm View
   
after updating the query line no error appear but all privileges have (No) value
Golden Basim 2-Dec-15 17:17pm View
   
same error with "computer name" or "ip" or "localhost"
Golden Basim 2-Dec-15 17:07pm View
   
thank you now i can create new user ,, this error appear in the second part of the code during grant the rights.
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'database.* TO 'ttt3'@'%'' at line 1
Golden Basim 2-Dec-15 16:46pm View
   
ok
Golden Basim 2-Dec-15 16:23pm View
   
i tried with this code but error appear 'Host 'JE-PC' is not allowed to connect to this MySQL server'

MySqlConnection connection001 = new MySqlConnection("Data Source=" + Publics.server + ";UserId=" + Publics.uid + ";PWD=" + Publics.password + "topSecretPassword;");
string query = "INSERT INTO users(user_name, password, admin) VALUES('" + Userdd + "','" + Pass + "', '1')";
MySqlCommand command = new MySqlCommand(query, connection001);
connection001.Open();
command.ExecuteNonQuery();


query = "CREATE USER '" + Userdd + "' IDENTIFIED BY '" + Pass + "'";
command = new MySqlCommand(query, connection001);
command.ExecuteNonQuery();

query = "GRANT SELECT, SHOW DATABASES ON database.* TO '" + Userdd + "'@'%'";
command = new MySqlCommand(query, connection001);
command.ExecuteNonQuery();
Golden Basim 1-Dec-15 19:34pm View
   
thank you for your answer,
i have MySQL Connector and i can insert ,edit ,select,.. using c# and i can Grant PRIVILEGES on database manually.
my problem is how i can make this by c# code ( i went all this steps happen in the first form).
Golden Basim 1-Dec-15 19:22pm View
   
i don't went the customer create database using XAMPP and write code to GRANT ALL PRIVILEGES to user "root" manually ,
what i need that my program make this thing by code ..
customers don't like more complex steps to install my program on it's computer.
Golden Basim 25-Nov-15 2:02am View
   
but i use localdb
Golden Basim 25-Oct-15 18:34pm View
   
$sql = "INSERT INTO inst_basic_info (inst_name, inst_directorate, inst_administration)VALUES ('$inst_name', '$inst_directorate', '$inst_administration')";
if ($dbc->query($sql) === TRUE)
{
?>
<script>
alert('');
window.location.href='../admin/index.php?pth=modules/institution&page=inst_add';
</script>
Golden Basim 25-Oct-15 18:26pm View
   
this error appear
error while inserting , TRY AGAIN You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''inst_name') VALUES('PHP Institution')' at line 1
Golden Basim 25-Oct-15 16:40pm View
   
yes, $sql="INSERT INTO inst_basic_info('inst_name') VALUES('".$inst_name."')";
same error
Golden Basim 25-Oct-15 16:18pm View
   
no, i write "satate" intentionally.
Golden Basim 25-Oct-15 13:24pm View
   
php with mysql, thanks
Golden Basim 21-Oct-15 9:38am View
   
thanks , this solved the problem
Golden Basim 23-Aug-15 13:50pm View
   
vs 2010 ultimade
Golden Basim 23-Aug-15 3:16am View
   
i downloaded this files wix39-binaries.zip ,wix39.exe
then i installed wix39.exe
what showld i do ?
Golden Basim 22-Aug-15 18:02pm View
   
good tool but it's controls don't appear above solution explorer
Golden Basim 12-Jul-15 5:53am View
   
if i installed Express edition on the user pc , the project will work ?
Golden Basim 11-Jun-15 4:43am View
   
no i went to change the name of my app in "regedit"
Golden Basim 10-Jun-15 3:07am View
   
yes
Golden Basim 9-Jun-15 17:49pm View
   
the result : NET FRAMEWORK ( 2,0,50727,0).

but by check it manually i founded onther version with value ( 4,0,30319,0).
how i can ask if net framework is 4.0 or above direct ?
Golden Basim 9-Jun-15 17:38pm View
   
local machine
Golden Basim 9-Jun-15 8:19am View
   
i need c# code
Golden Basim 9-Apr-15 12:08pm View
   
how i know the date time value of .NET framework's standards.
Golden Basim 9-Apr-15 11:46am View
   
i changed custom format of date time picker to : yyyy-MM-dd , but no changes , please give me sample .. i use vs 2010
Golden Basim 9-Apr-15 9:36am View
   
what i should to do to solve this problem ?
Golden Basim 7-Apr-15 5:14am View
   
i don't know the code ..

i create app with c# and mysql database ..
every time i turn on my pc , i should to start xampp and start appache,mysql
i went appache,mysql start when i run my app
Golden Basim 5-Apr-15 16:36pm View
   
i don't think that , i used the same connection sring with other code and work good
Golden Basim 5-Apr-15 16:34pm View
   
no mesage appear but no result ( no data appear )
Golden Basim 5-Apr-15 0:33am View
   
"Data Source="+ System.IO.Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location),"jepsalesdb.sdf");
Golden Basim 2-Apr-15 19:13pm View
   
i need to control on this dialog Programmatically
Golden Basim 1-Apr-15 17:12pm View
   
after installing the application on another pc on the network , i need the user choose the server name ?
Golden Basim 26-Mar-15 11:34am View
   
no i have only sql 2008 R2 , do it work if i install sql 2008 sp3 ? http://www.microsoft.com/en-eg/download/details.aspx?id=27594
Golden Basim 26-Mar-15 11:16am View
   
i don't know .. i uploaded photo with the error that appear
Golden Basim 26-Mar-15 10:22am View
   
Deleted
how i make the database accept network connections ?

and what is the mew connection string syntax ?
Golden Basim 26-Mar-15 10:20am View
   
how i make computer with the database accept network connections ??

what is the syntax of new connection string ?
Golden Basim 26-Mar-15 9:55am View
   
can i make that by c# code or during setup my app ?
Golden Basim 26-Mar-15 9:54am View
   
i went to make the application work on network
Golden Basim 26-Mar-15 9:53am View
   
i went to make the application work on network , so i need sql server ..

there is method to install sql + athached the database + install my app from one file ??
i went the user install the app easy ..
Golden Basim 26-Mar-15 8:56am View
   
windows application , so i must install sqlserver on pc ( that will be as server )?
how can i exoprt database from sql server ( on my pc) and attached to sql server (on customer pc )?
Golden Basim 12-Feb-15 10:24am View
   
Thanks a lot
Golden Basim 12-Feb-15 10:23am View
   
yes , it work .

thank you
Golden Basim 12-Feb-15 9:59am View
   
the error appear here : label11.Text = DEF.ToString("hh:mm:ss");
Golden Basim 12-Feb-15 9:52am View
   
string JCM_NOW = DateTime.Now.ToString("HH:mm:ss");
DateTime JCM_NOW_DT = Convert.ToDateTime(JCM_NOW);
Golden Basim 12-Feb-15 9:42am View
   
Input string was not in a correct format.
Golden Basim 12-Feb-15 9:41am View
   
error appear :
in this line :
label11.Text = string.Format("{0:00}:{1:00}:{2:00)", DEF.Hours, DEF.Minutes, DEF.Seconds);

or in this line :
// Or if by HH:mm:ss you mean TotalHours
label11.Text = string.Format("{0:00}:{1:00}:{2:00)", DEF.TotalHours, DEF.Minutes, DEF.Seconds);

Input string was not in a correct format.
Golden Basim 12-Feb-15 8:23am View
   
something
Golden Basim 11-Feb-15 20:16pm View
   
how i can close file too ?
Golden Basim 11-Feb-15 20:04pm View
   
Deleted
and for the file how i can close it ?
Golden Basim 11-Feb-15 19:25pm View
   
Dispose closes the stream not file ?

thats mean that the file still open ?
Golden Basim 11-Feb-15 18:00pm View
   
the same error :


using (FileStream fileStream_1 = new FileStream(JCM_File_Path_01, FileMode.Open, FileAccess.Read, FileShare.Read))
{

if (Startdate2 == JCM_NOW2)
{
if (checkBox1.Checked == true)
{
try
{
fileStream_1 = null;
System.Diagnostics.Process.Start(System.Convert.ToString(row.Cells["Lec_media"].Value));
}
finally
{
if (fileStream_1 != null)
fileStream_1.Close();
}
}

}



if (Enddate2 == JCM_NOW2)
{
// if (fileStream_1 != null) ((IDisposable)fileStream_1).Dispose();
fileStream_1.Close();

// this code does not close the file which opened above .. why?


}
}
Golden Basim 11-Feb-15 17:56pm View
   
the same error after removing if (obj != null) ((IDisposable)obj).Dispose();
Golden Basim 11-Feb-15 17:39pm View
   
how can i use (using) in more than scope ?

if ( .... )
{
using (FileStream stream = new FileStream( /* ... */ )) {
// use stream object here
}

if(.....)
{

// Dispose

}
}
Golden Basim 19-Mar-14 7:07am View
   
same error
Golden Basim 19-Mar-14 7:06am View
   
:] the data : http://postimg.org/image/ren4g24mt/
Golden Basim 19-Mar-14 6:41am View
   
thank you

i used ur code :


string JSS_connetionString01 = null;
JSS_connetionString01 = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|/je_salestoredb.mdb;Persist Security Info=True;Jet OLEDB:Database Password=JE2014";

using (OleDbConnection JSS_cnn01 = new OleDbConnection(JSS_connetionString01))
{
JSS_cnn01.Open();
using (OleDbCommand JSS_cmd01 = new OleDbCommand("SELECT SUM(sivd_Qnt) AS sivd_Qnt FROM sales_invoices_details WHERE sivd_Sale_DATE BETWEEN @SD AND @ED", JSS_cnn01))
{
JSS_cmd01.Parameters.AddWithValue("@SD", dateTimePicker1.Value);
JSS_cmd01.Parameters.AddWithValue("@ED", dateTimePicker2.Value);
using (OleDbDataReader JSS_reader01 = JSS_cmd01.ExecuteReader())
{
if (JSS_reader01.Read())
{
int JSS_qnt01 = (int) JSS_reader01["sivd_Qnt"];

JSS_cmd01.Dispose();
JSS_cnn01.Close();

textBox5.Text = JSS_qnt01.ToString("000"); ;
}


}

}
}




but this error appeared here (int JSS_qnt01 = (int) JSS_reader01["sivd_Qnt"];)

Specified cast is not valid.
and at ( JSS_reader01) this error appeared
Cannot evaluate expression because the code of the current method is optimized.
Golden Basim 19-Mar-14 6:39am View
   
thanks , the same error !!!
Golden Basim 7-Mar-14 12:10pm View
   
i'm so sorry , i have another method with the same name ( GetData )
,
the result after delete the another method and editing the code is :-

error at GetData("");
The best overloaded method match for 'JE_SaleStore.JSS_Admin_Employees.GetData(System.Data.OleDb.OleDbConnection)' has some invalid arguments
Golden Basim 6-Mar-14 13:01pm View
   
after editing

static void GetData(OleDbConnection connection) {
// the code ....

frm.employeesDataGridView.DataSource = null;
string JSS_sql011 = "select * from employees";


// to the end ....


and no change
Golden Basim 6-Mar-14 12:53pm View
   
this right but,
how to make the data of gridview to null ??

after editing
this.employeesDataGridView.Controls.Clear(); // do n't work
this.employeesDataGridView = null; // do n't work
GetData("");

and no thing change
Golden Basim 6-Mar-14 12:40pm View
   
i write this code :






private void button1_Click(object sender, EventArgs e)
{
//insert code
/*

*/
GetData("");
}



static void GetData(OleDbConnection connection)
{
string JSS_connetionString011 = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|/je_salestoredb.mdb;Persist Security Info=True;Jet OLEDB:Database Password=JE2014";
DataSet JSS_ds011 = new DataSet();
DataTable dt = new DataTable();
string JSS_sql011 = "select * from employees";
OleDbConnection JSS_connection011 = new OleDbConnection(JSS_connetionString011);
OleDbDataAdapter JSS_dataadapter011 = new OleDbDataAdapter(JSS_sql011, JSS_connection011);
JSS_dataadapter011.SelectCommand = new OleDbCommand(JSS_sql011, JSS_connection011);
JSS_ds011.Clear();
try
{
JSS_Admin_Employees frm = new JSS_Admin_Employees();

JSS_connection011.Open();
JSS_dataadapter011.Fill(JSS_ds011, "employees");
JSS_connection011.Close();
frm.employeesDataGridView.DataSource = JSS_ds011;
frm.employeesDataGridView.DataMember = "employees";
frm.employeesDataGridView.DataSource = JSS_ds011.Tables[0];



}
catch (Exception ex)
{

return;
}

}





result :
no thing happen for Data Grid View but , but when i moved the Scroll bar the new value appeared Instead of first record.
Golden Basim 6-Mar-14 12:19pm View
   
thanks for reply
i used all this answer but don't work ,

1-
http://stackoverflow.com/questions/1449773/c-sharp-windows-forms-basic-data-grid


2-
string JSS_connetionString011 = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|/je_salestoredb.mdb;Persist Security Info=True;Jet OLEDB:Database Password=JE2014";
string JSS_sql011 = "select * from employees";
OleDbConnection JSS_connection011 = new OleDbConnection(JSS_connetionString011);
OleDbDataAdapter JSS_dataadapter011 = new OleDbDataAdapter(JSS_sql011, JSS_connection011);
DataSet JSS_ds011 = new DataSet();
JSS_dataadapter011.Fill(JSS_ds011, "employees");
employeesDataGridView.DataSource = JSS_ds011.Tables["employees"];




3-
//Refresh
this.employeesTableAdapter.Fill(this.je_salestoredb.employees);
employeesDataGridView.Refresh();


how i can to bind the data again to the gridview
Golden Basim 6-Mar-14 10:14am View
   
I've added
Golden Basim 5-Mar-14 8:40am View
   
with sorrow,The same problem

Screen flashed (show the new value and disappear quickly and does not show except in the next time)
Golden Basim 5-Mar-14 8:34am View
   
my first code make refresh to data grid veiw, but after pressing the button twice and don't show the current input but it works well if it is put in a separate button Event

code:

string JSS_connetionString011 = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|/je_salestoredb.mdb;Persist Security Info=True;Jet OLEDB:Database Password=JE2014";
DataSet JSS_ds011 = new DataSet();
string JSS_sql011 = "select * from employees";
OleDbConnection JSS_connection011 = new OleDbConnection(JSS_connetionString011);
OleDbDataAdapter JSS_dataadapter011 = new OleDbDataAdapter(JSS_sql011, JSS_connection011);
JSS_dataadapter011.SelectCommand = new OleDbCommand(JSS_sql011, JSS_connection011);
JSS_ds011.Clear();
try
{

JSS_connection011.Open();
JSS_dataadapter011.Fill(JSS_ds011, "employees");
JSS_connection011.Close();
employeesDataGridView.DataSource = JSS_ds011;
employeesDataGridView.DataMember = "employees";
// employeesDataGridView.DataSource = JSS_ds011.Tables(0);

}
catch (Exception ex)
{

return;
}
Golden Basim 5-Mar-14 8:24am View
   
thanks for reply:
by add this line employeesDataGridView.DataSource = JSS_ds011.Tables(0);
error :
Non-invocable member 'System.Data.DataSet.Tables' cannot be used like a method.
Golden Basim 4-Mar-14 17:07pm View
   
please help ,
( in every time click on the button , the Previous record only that appear in the grid view not the Current)
Golden Basim 3-Mar-14 14:23pm View
   
this.employeesDataGridView.EndEdit();
this.employeesDataGridView.Refresh();
this.employeesDataGridView.Parent.Refresh();

( don't work )





employeesDataGridView.DataBindings.Clear();


this.employeesTableAdapter.Fill(this.je_salestoredbDataSet.employees);
employeesDataGridView.Update();
employeesDataGridView.Refresh();

( don't work )
Golden Basim 3-Mar-14 2:37am View
   
no change
Golden Basim 2-Mar-14 23:38pm View
   
thanks for reply

Error System.Windows.Forms.DataGridView' does not contain a definition for 'DataBind' and no extension method 'DataBind' accepting a first argument of type 'System.Windows.Forms.DataGridView' could be found
Golden Basim 23-Feb-14 13:01pm View
   
thank you