Closed sanketgroup closed 3 years ago
mistakes from your side
1 mistake from documentation
So your code should be
public Tally Ctally = new Tally();
private void Form2_Load(object sender, EventArgs e)
{
TallyInit();
}
private async void TallyInit()
{
string VoucherNumber = "vchnum";
string Date = "somedate";
string VoucherMasterID = "vchmasterid";
Voucher voucher = await Ctally.GetVoucherByVoucherNumber(VoucherNumber, Date);
//If you have master id of voucher
Voucher voucher2 = await Ctally.GetVoucherByMasterID(VoucherMasterID);
}
You need to add break point at voucher and voucher2 to see data
I might be wrong given less experience with C#. Following what I did, but not working.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using TallyConnector;
using TallyConnector.Models;
namespace tallytest
{
public Tally Ctally = new Tally();
private void Form2_Load(object sender, EventArgs e)
{
TallyInit();
}
private async void TallyInit()
{
string VoucherNumber = "vchnum";
string Date = "somedate";
string VoucherMasterID = "vchmasterid";
Voucher voucher = await Ctally.GetVoucherByVoucherNumber("JV263", "20210331");
//If you have master id of voucher
Voucher voucher2 = await Ctally.GetVoucherByMasterID(VoucherMasterID);
}
You removed class definition
namespace tallytest
{
Public partial class Form2:Form
{
//Code goes here
}
}
Getting following issue
Try this Replace
using System.Windows.Forms;
with
using WF = System.Windows.Forms;
Form with WF.Form
Getting error in program.cs when clicking on button.
Compare your previous code and this code - You will know you Removed
public Form1(){
InitializeComponent();
}
@sanketgroup I added WPF example to the repo you can check now
Compare your previous code and this code - You will know you Removed
public Form1(){ InitializeComponent(); }
It gives error when I keep that .. Screenshot attached in previous post. Posting again.
===================
Create a new windows forms application and try
Create a new windows forms application and try
I did that way, but the same error.
Also Could you please add an example project for .Net framework? ( i see only .Net core)
example works for both(c#)
Also added WinForms example check
while building your example, getting this error may be due to .Net5.0 core, which I do not have.
=============
You can copy code in form1 class and paste in your Form1 class It works fine Provided add Change button click event of your button to button1_Click in example code
pls see attached video. (this is not Net.Core) (This is on .Net Framework)
https://user-images.githubusercontent.com/6008084/123231811-2a339900-d4f6-11eb-8a2c-b20dc8466747.mp4
There were some unmerged commits in .net Framework Now fetch latest repo from github and build it will work
Send me your anydesk ID at contact@saivineeth.com
Hello, I did the following code in C#, just to start with basics. I get errors as shown in screenshots. Pls help. Thanks