For those new to message boards please try to follow a few simple rules when posting your question.
Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
Keep the subject line brief, but descriptive. eg "File Serialization problem"
Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
No advertising or soliciting.
We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
Sorry I could not respond last night because I didn't have access to my laptop from where I was.
SetInitialRow() is called in page_load() event:
SetInitialRow2() is called in populateRecord function:
foreach (RepeaterItem item in Repeater1.Items)
string registerNumber = (item.FindControl("txtboatregNum") as TextBox).Text;
string bregisterNumber = (item.FindControl("cgaurdNumber") as TextBox).Text;
if (item.ItemIndex == 0)
foreach (RepeaterItem Item in Repeater2.Items)
(Item.FindControl("BtnAdd2") as Button).Visible = Repeater2.Items.Count >2;
(Item.FindControl("btnDelete2") as Button).Visible = Repeater2.Items.Count >2;
which in turn is called by the NEXT button click event:
<pre>protected void OnClickNext(object sender, EventArgs e)
int rowIndex = 0;
if (ViewState["CurrTable"] != null)
DataTable dtCurrentTable = (DataTable)ViewState["CurrTable"];
if (dtCurrentTable.Rows.Count >0)
for (int i = 1; i <= Repeater1.Items.Count; i++)
TextBox tbboatregNum = (TextBox)Repeater1.Items[rowIndex].FindControl("txtboatregNum");
TextBox tbPayerret = (TextBox)Repeater1.Items[rowIndex].FindControl("txtPayerret");
TextBox tbCGvesselNum = (TextBox)Repeater1.Items[rowIndex].FindControl("cgaurdNumber");
TextBox tbCGtaxpayerret = (TextBox)Repeater1.Items[rowIndex].FindControl("cguardreturnedval");
dtCurrentTable.Rows[i - 1]["MarineRegNo"] = tbboatregNum.Text;
dtCurrentTable.Rows[i - 1]["TaxPyrRetdVal"] = tbPayerret.Text;
dtCurrentTable.Rows[i - 1]["VesselRegNo"] = tbCGvesselNum.Text;
dtCurrentTable.Rows[i - 1]["VesselTaxPyrRetdVal"] = tbCGtaxpayerret.Text;
ViewState["TempData"] = dtCurrentTable;
myMultiView.ActiveViewIndex += 1;
if (myMultiView.ActiveViewIndex != 3)
So, clicking next is supposed to pass these values from Repeater1 to Repeater2.
There are also some other dependencies like getting the total value of TaxPyrRetdVal and VesselTaxPyrRetdVal but they are not relevant because once Repeater is able
to recognize MarineRegNo and VesselRegNo, the others become visible.
Then there are a couple of stored procedures that populate both SetInitialRow() and SetInitialRow2() datatables.
If you remove SetInitialRow2(), then there is no issues with passing the values from Repeater1 to Repeater2.
Only issue there is that the values for Repeater2 will not be passed, only those two form values, MarineRegNo and VesselRegNo are passed.
I must admit that I didn't do all of these by myself.
It is really very long and complicated code.
If I can figure out a way to check the dt datable table values before binding to Repeater, perhaps this could work.
Also, if I remove the stored procedures, everything will be populated on both repeaters except the two most important iems MarineRegNo and VesselRegNo.
I have been stuck on this now for days and was supposed to be demo'ing this app this morning.
Thanks sir as usual for all your expert assistance.
Thanks for the quote buddy......... i think you miss something, the connection string i declared that was in Appconfig .... '
' and you doesn't even wanted to know where is my connection string for SQL.......?? but you commented on me. good. Please check the code properly.. And another thing please don't give the free Quote without judgement. Thanks
That's a hard-set connection string, not being pulled from AppConfig. The only part being set in appConfig is the machine path for the directory where the files are stored. You can set a connectionString in AppConfig all day and it literally doesn't matter if you don't use it.
Member 12863453 wrote:
OleDbConnection excelConnection = new OleDbConnection(excelConnectionString);
That's a class that uses the OLEDB provider to connect. That's meant for Office products, not SQL Server. It MIGHT work with SQL Server if the Client Tools Connectivity pack is installed on said server instance, but there's literally no point in using it when you have the native driver available (namely, SqlConnection).
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
Sorry i think i failed to present you the issue..... actually it stuck in there and don't forward to next statement. and go back to the previous method "Upload". So that i told the loop thing. actually there was no loop in that statement. but during this process the service not stopped even once but it continuously repeat the statements
//I query the db in pageload() event://We query the DB only once in the Page Load
con = new SqlConnection(ConfigurationManager.ConnectionStrings["ppmtest"].ToString());
string sSQL = "Select sID,sName from states ORDER By sName ASC";
SqlCommand cmd3 = new SqlCommand(sSQL, con);
cstable = new DataTable();
//Then I call it in ItemDataBound...) eventprotectedvoid repeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
var ddlPState = (DropDownList)e.Item.FindControl("ddlPrevState");
ddlPState.DataSource = cstable;
ddlPState.DataTextField = "sName";
ddlPState.DataValueField = "sID";
If I am deploying my site on domain directly all static files are getting loaded and my website is running fine but as I am deploying my website in sub domain, none of the static file(css, fonts, js) is getting loaded.
googled first but do not find any suitable one. so looking for a details article on repository and data access code in dotnet core unit testing
where we will not use any 3rd part library like mock or effort rather use anything built-in.
anything exist such like ?
can we unit test repository and data access code with intellitrace ? share idea. thanks
First of all I'd ask why you don't want to use a mocking framework, it'll make your life a lot easier. However if you don't want to use one then you can use a technique called self-shunting. That is where the test class itself acts as the mocked object and you can write any code you want in your "mocked" methods.
In this brief example I have a ProductService class that uses an IProductRepository to access the products. There's only a simply Get method but it gives you the rough idea. So in my unit test I make the test class implement IProductRepository and I mock the Get method in the test class itself.
I just started to be assigned a work station that was low on memory so I accidently removed the wrong version of the .net framework. To correct the problem, I downloaded .net framework 4.0 since that is what the application uses. This web form application uses vb.net 2010 visual studio ide.
I problem is I probably downloaded the wrong version. The application probably was using a version number 4.3 I am guessing.
Thus I am trying to determine what I need to do to solve the problem.
Here is where the steps of where the problem lies:
'retarget the project to .net framework 4.0. After the project opens, you can retarget the
1. When I try to debug the application, I get the following error message:
”Retarget the project to .net framework 4.0.
Once I see the above message, I just click the OK button. I do not know where to point the application.
2. After that point I get lots of messages that look like the following:
AttendanceLetters\App_Code\mylistbox.vb(1): Build (web): Reference assemblies for target .NET Framework version not found; please ensure they are installed, or select a valid target version.
Thus to solve the problem can you tell me the following:
1. Can you tell me and/or point to a url (link) that will solve the problem tell me how and/or how to point the application to the correct target link?
2. If that is not possible, do I need to download some version of the .net framework that the application is expecting to see? If so, how can I tell what version the application is looking for?
3. If the above solutions do not work. should I uninstall the visual studio 2010 that is on this workstation and reinstall a new version so that the application can find the correct version of the .net framework?
4. If you have a different solution would you tell me what I should do to solve the problem?
Last Visit: 31-Dec-99 18:00 Last Update: 21-Sep-17 5:30